Author: igorz
Date: 2006-10-31 08:11:40 -0500 (Tue, 31 Oct 2006)
New Revision: 67176

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewRowTest.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs
   
trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DetailsViewProperties1.aspx
Log:
2006-10-31 Igor Zelmanovich <[EMAIL PROTECTED]>

        * DetailsView.cs: fixed: PageIndex, UpdateItem, InsertItem.



Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-10-31 13:00:02 UTC (rev 67175)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-10-31 13:11:40 UTC (rev 67176)
@@ -1,6 +1,6 @@
-2006-10- Igor Zelmanovich <[EMAIL PROTECTED]>
+2006-10-31 Igor Zelmanovich <[EMAIL PROTECTED]>
 
-       * RadioButtonList.cs: fixed: has no html output when Items.Count=0.
+       * DetailsView.cs: fixed: PageIndex, UpdateItem, InsertItem.
 
 2006-10-29 Igor Zelmanovich <[EMAIL PROTECTED]>
 

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs 
2006-10-31 13:00:02 UTC (rev 67175)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/DetailsView.cs 
2006-10-31 13:11:40 UTC (rev 67176)
@@ -770,6 +770,8 @@
                                return pageIndex;
                        }
                        set {
+                               if (value < 0)
+                                       throw new ArgumentOutOfRangeException 
("PageIndex must be non-negative");
                                if (value == pageIndex)
                                        return;
                                pageIndex = value;
@@ -809,8 +811,7 @@
                
                
                [DefaultValue (null)]
-               /* DataControlPagerCell isnt specified in the docs */
-               //[TemplateContainer (typeof(DataControlPagerCell), 
BindingDirection.OneWay)]
+               [TemplateContainer (typeof (DetailsView), 
BindingDirection.OneWay)]
                [PersistenceMode (PersistenceMode.InnerProperty)]
                [Browsable (false)]
                public virtual ITemplate PagerTemplate {
@@ -1485,12 +1486,15 @@
                
                void UpdateItem (string param, bool causesValidation)
                {
-                       if (causesValidation)
+                       if (causesValidation && Page != null)
                                Page.Validate ();
                        
-                       if (CurrentMode != DetailsViewMode.Edit) throw new 
NotSupportedException ();
+                       if (CurrentMode != DetailsViewMode.Edit) throw new 
HttpException ();
                        
-                       currentEditOldValues = oldEditValues.Values;
+                       if (oldEditValues == null)
+                               currentEditOldValues = new OrderedDictionary ();
+                       else
+                               currentEditOldValues = oldEditValues.Values;
 
                        currentEditRowKeys = DataKey.Values;
                        currentEditNewValues = GetRowValues (false, false);
@@ -1526,17 +1530,19 @@
                
                void InsertItem (string param, bool causesValidation)
                {
-                       if (causesValidation)
+                       if (causesValidation && Page != null)
                                Page.Validate ();
                        
-                       if (CurrentMode != DetailsViewMode.Insert) throw new 
NotSupportedException ();
+                       if (CurrentMode != DetailsViewMode.Insert) throw new 
HttpException ();
                        
                        currentEditNewValues = GetRowValues (false, true);
                        DetailsViewInsertEventArgs args = new 
DetailsViewInsertEventArgs (param, currentEditNewValues);
                        OnItemInserting (args);
                        if (!args.Cancel) {
                                DataSourceView view = GetData ();
-                               if (view != null && view.CanInsert)
+                               if (view == null)
+                                       throw new HttpException ("The 
DataSourceView associated to data bound control was null");
+                               if (view.CanInsert)
                                        view.Insert (currentEditNewValues, new 
DataSourceViewOperationCallback (InsertCallback));
                        }
                        else

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-10-31 13:00:02 UTC (rev 67175)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-10-31 13:11:40 UTC (rev 67176)
@@ -1,5 +1,10 @@
 2006-10-30 Igor Zelmanovich <[EMAIL PROTECTED]>
 
+       * DetailsViewRowTest.cs: removed NotWorking attributes
+       * DetailsViewTest.cs: removed NotWorking attributes
+                       
+2006-10-30 Igor Zelmanovich <[EMAIL PROTECTED]>
+
        * FormViewTest.cs: removed NotWorking attributes
                        
 2006-10-30 Igor Zelmanovich <[EMAIL PROTECTED]>

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewRowTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewRowTest.cs 
    2006-10-31 13:00:02 UTC (rev 67175)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewRowTest.cs 
    2006-10-31 13:11:40 UTC (rev 67176)
@@ -108,10 +108,9 @@
                private bool dataUpdating=false;
 
                [Test]
-               [Category ("NotWorking")]// NullReferenceException
                public void DetailsViewRow_BubbleEvent ()
                {
-                       DetailsView dv = new DetailsView ();
+                       DetailsView dv = new DetailsView ();
                        dv.Page = new Page ();
                        PokerDetailsViewRow row = new PokerDetailsViewRow (2, 
DataControlRowType.Footer, DataControlRowState.Insert);
                        Button bt = new Button ();

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs
===================================================================
--- 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs    
    2006-10-31 13:00:02 UTC (rev 67175)
+++ 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/DetailsViewTest.cs    
    2006-10-31 13:11:40 UTC (rev 67176)
@@ -542,14 +542,13 @@
                }
 
                [Test]
-               [Category ("NotWorking")] 
                public void DetailsView_AssignedPropertiesRender ()
                {
                        string RenderedPageHtml = new WebTest 
("DetailsViewProperties1.aspx").Run ();
                        string newHtmlValue = RenderedPageHtml.Substring 
(RenderedPageHtml.IndexOf ("starttest") + 9, RenderedPageHtml.IndexOf 
("endtest") - RenderedPageHtml.IndexOf ("starttest") - 9);
                        string origHtmlValue = @" <div>
                        <div>
-                       <table cellspacing=""20"" cellpadding=""30"" 
rules=""all"" border=""1"" id=""DetailsView1"" 
style=""height:50px;width:125px;background-image:url(Blue%20hills.jpg);"">
+                       <table cellspacing=""20"" cellpadding=""30"" 
rules=""all"" border=""1"" id=""DetailsView1"" 
style=""height:50px;width:125px;background-image:url(Blue_hills.jpg);"">
                        <caption align=""Bottom"">
                        Caption Test
                        </caption><tr>
@@ -567,8 +566,7 @@
                        Assert.AreEqual (true, origHtmlValue.Contains 
(@"cellspacing=""20"""), "CellspacingRender");
                        Assert.AreEqual (true, origHtmlValue.Contains ("Caption 
Test"), "CaptionRender");
                        Assert.AreEqual (true, origHtmlValue.Contains 
(@"caption align=""Bottom"""), "CaptionalignRender");
-                       Assert.AreEqual (true, origHtmlValue.Contains 
("Blue%20hills.jpg"), "BackImageRender");
-                       Assert.AreEqual (true, origHtmlValue.Contains 
("Blue%20hills.jpg"), "BackImageRender");
+                       Assert.AreEqual (true, origHtmlValue.Contains 
("Blue_hills.jpg"), "BackImageRender");
                        //GridLines and HorizontalAlign were set but can not be 
shown in this rendering.
                }
 
@@ -777,7 +775,6 @@
                //ToDo: UpdateItem method should be checked using postback
                private bool updateItem = false;
                [Test]
-               [Category ("NotWorking")] 
                public void DetailsView_UpdateItem ()
                {
                        PokerDetailsView dv = new PokerDetailsView ();
@@ -1784,7 +1781,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")] 
                [ExpectedException (typeof (ArgumentOutOfRangeException))]
                public void PageIndexException ()
                {
@@ -1793,7 +1789,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")] 
                [ExpectedException (typeof (HttpException))]
                public void InsertItemException ()
                {
@@ -1802,7 +1797,6 @@
                }
 
                [Test]
-               [Category ("NotWorking")] 
                [ExpectedException (typeof (HttpException))]
                public void UpdateItemException ()
                {

Modified: 
trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DetailsViewProperties1.aspx
===================================================================
--- 
trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DetailsViewProperties1.aspx
      2006-10-31 13:00:02 UTC (rev 67175)
+++ 
trunk/mcs/class/System.Web/Test/mainsoft/NunitWebResources/DetailsViewProperties1.aspx
      2006-10-31 13:11:40 UTC (rev 67176)
@@ -10,7 +10,7 @@
     <form id="form1" runat="server">
     starttest
     <div>
-        <asp:DetailsView ID="DetailsView1" runat="server" BackImageUrl="Blue 
hills.jpg"
+        <asp:DetailsView ID="DetailsView1" runat="server" 
BackImageUrl="Blue_hills.jpg"
             Caption="Caption Test" CaptionAlign="Bottom" CellPadding="30" 
CellSpacing="20"
             DataSourceID="ObjectDataSource1" Height="50px" Width="125px">
         </asp:DetailsView>

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to