Author: igorz
Date: 2006-12-07 09:51:20 -0500 (Thu, 07 Dec 2006)
New Revision: 69181

Modified:
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
   trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs
Log:
2006-12-07 Igor Zelmanovich <[EMAIL PROTECTED]>

        * FormView.cs: fixed: avoid empty row rendering.



Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-12-07 14:43:19 UTC (rev 69180)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog      
2006-12-07 14:51:20 UTC (rev 69181)
@@ -1,3 +1,7 @@
+2006-12-07 Igor Zelmanovich <[EMAIL PROTECTED]>
+
+       * FormView.cs: fixed: avoid empty row rendering.
+
 2006-12-06 Igor Zelmanovich <[EMAIL PROTECTED]>
 
        * AdRotator.cs: fixed: 

Modified: trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs
===================================================================
--- trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2006-12-07 14:43:19 UTC (rev 69180)
+++ trunk/mcs/class/System.Web/System.Web.UI.WebControls/FormView.cs    
2006-12-07 14:51:20 UTC (rev 69181)
@@ -964,11 +964,18 @@
                                if ((row.RowState & DataControlRowState.Edit) 
!= 0) {
                                        if (editItemTemplate != null)
                                                editItemTemplate.InstantiateIn 
(cell);
+                                       else
+                                               row.Visible = false;
                                } else if ((row.RowState & 
DataControlRowState.Insert) != 0) {
                                        if (insertItemTemplate != null)
                                                
insertItemTemplate.InstantiateIn (cell);
-                               } else if (itemTemplate != null)
+                                       else
+                                               row.Visible = false;
+                               }
+                               else if (itemTemplate != null)
                                        itemTemplate.InstantiateIn (cell);
+                               else
+                                       row.Visible = false;
                        }
                        else if (row.RowType == DataControlRowType.EmptyDataRow)
                        {

Modified: trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-12-07 14:43:19 UTC (rev 69180)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/ChangeLog 
2006-12-07 14:51:20 UTC (rev 69181)
@@ -1,3 +1,7 @@
+2006-12-07  Igor Zelmanovich   <[EMAIL PROTECTED]>
+
+       * FormViewTest.cs: fixed tests.
+
 2006-12-06  Vladimir Krasnov  <[EMAIL PROTECTED]>
 
        * CreateUserWizardTest.cs: fixed postback tests button id

Modified: 
trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs
===================================================================
--- trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs   
2006-12-07 14:43:19 UTC (rev 69180)
+++ trunk/mcs/class/System.Web/Test/System.Web.UI.WebControls/FormViewTest.cs   
2006-12-07 14:51:20 UTC (rev 69181)
@@ -1471,32 +1471,27 @@
                {
                        string RenderedPageHtml = new WebTest 
("FormViewTest1.aspx").Run ();
                        string newHtmlValue = RenderedPageHtml.Substring 
(RenderedPageHtml.IndexOf ("test3") + 5, RenderedPageHtml.IndexOf ("test4") - 
RenderedPageHtml.IndexOf ("test3") - 5);
-                       string origHtmlValue = @" <table cellspacing=""0"" 
cellpadding=""2"" border=""0"" id=""FormView3"" 
style=""color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;"">
-                               <tr align=""center"" valign=""top"" 
style=""color:#C00000;background-color:Tan;font-weight:bold;"">
-                               <td colspan=""2"">
-                               <span id=""FormView3_Label5"">Header Template 
Test</span>
-                               </td>
-                               </tr><tr>
-                               <td colspan=""2"">
-                               <span id=""FormView3_Label4"">1</span>
-                               </td>
-                               </tr><tr align=""center"" 
style=""color:DarkSlateBlue;background-color:PaleGoldenrod;"">
-                               <td colspan=""2""><table border=""0"">
-                               <tr>
-                               <td><span>1</span></td><td>
-                               <a 
href=""javascript:__doPostBack('FormView3','Page$2')"" 
style=""color:DarkSlateBlue;"">2</a></td><td>
-                               <a 
href=""javascript:__doPostBack('FormView3','Page$3')"" 
style=""color:DarkSlateBlue;"">3</a></td><td>
-                               <a 
href=""javascript:__doPostBack('FormView3','Page$4')"" 
style=""color:DarkSlateBlue;"">4</a></td><td>
-                               <a 
href=""javascript:__doPostBack('FormView3','Page$5')"" 
style=""color:DarkSlateBlue;"">5</a></td><td>
-                               <a 
href=""javascript:__doPostBack('FormView3','Page$6')"" 
style=""color:DarkSlateBlue;"">6</a></td>
-                               </tr><tr align=""right"" 
style=""color:#FFC0FF;background-color:Tan;"">
-                               <td colspan=""2"">
-                               <span id=""FormView3_Label6"">FormView 
Footer</span>
-                               </td>
-                               </tr>
-                               </table></td>
-                               </tr>
-                               </table>";        
+                       string origHtmlValue = @"<table cellspacing=""0"" 
cellpadding=""2"" border=""0"" id=""FormView3"" 
style=""color:Black;background-color:LightGoldenrodYellow;border-color:Tan;border-width:1px;border-style:solid;border-collapse:collapse;"">
+       <tr align=""center"" valign=""top"" 
style=""color:#C00000;background-color:Tan;font-weight:bold;"">
+               <td colspan=""2"">
+                <span id=""FormView3_Label5"">Header Template Test</span>
+            </td>
+       </tr><tr>
+               <td colspan=""2"">
+                <span id=""FormView3_Label4"">1</span>
+            </td>
+       </tr><tr align=""right"" style=""color:#FFC0FF;background-color:Tan;"">
+               <td colspan=""2"">
+                <span id=""FormView3_Label6"">FormView Footer</span>
+            </td>
+       </tr><tr align=""center"" 
style=""color:DarkSlateBlue;background-color:PaleGoldenrod;"">
+               <td colspan=""2""><table border=""0"">
+                       <tr>
+                               <td><span>1</span></td><td><a 
href=""javascript:__doPostBack('FormView3','Page$2')"" 
style=""color:DarkSlateBlue;"">2</a></td><td><a 
href=""javascript:__doPostBack('FormView3','Page$3')"" 
style=""color:DarkSlateBlue;"">3</a></td><td><a 
href=""javascript:__doPostBack('FormView3','Page$4')"" 
style=""color:DarkSlateBlue;"">4</a></td><td><a 
href=""javascript:__doPostBack('FormView3','Page$5')"" 
style=""color:DarkSlateBlue;"">5</a></td><td><a 
href=""javascript:__doPostBack('FormView3','Page$6')"" 
style=""color:DarkSlateBlue;"">6</a></td>
+                       </tr>
+               </table></td>
+       </tr>
+</table>";        
                        HtmlDiff.AssertAreEqual (origHtmlValue, newHtmlValue, 
"RenderingDefaultPaging");
                }
                
@@ -1924,11 +1919,17 @@
 
        public class TestMyData
        {
-               static IList<int> str = new List<int>();
-               //str.(new int[] { 1, 2, 3, 4, 5, 6 });
+               static IList<int> str;
+               //str.(new int[] { 1, 2, 3, 4, 5, 6 });
+
+               static TestMyData ()
+               {
+                       InitData ();
+               }
 
                public static void InitData()
-               {
+               {
+                       str = new List<int> ();
                        for (int i=1;i<7;i++)
                                str.Add (i);
                }

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

Reply via email to