Change the implementation of CreateControlHierarchy().
authorAlon Gazit <alon@mono-cvs.ximian.com>
Mon, 15 Dec 2003 12:29:42 +0000 (12:29 -0000)
committerAlon Gazit <alon@mono-cvs.ximian.com>
Mon, 15 Dec 2003 12:29:42 +0000 (12:29 -0000)
The current implementation renders extra Header and footer
without Repeater.DataSource assign.

svn path=/trunk/mcs/; revision=21165

mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog
mcs/class/System.Web/System.Web.UI.WebControls/Repeater.cs

index 04e88a1504f57bce4810b8de0e0bb99094e2f43c..8b96c33136532799d7e4da8e4bf304d7ba72ce03 100644 (file)
@@ -1,3 +1,9 @@
+2003-12-15  Alon Gazit <along@mainsoft.com>
+       * Repeater.cs: Change the implementation of CreateControlHierarchy().
+       The current implementation renders extra Header and footer 
+       without Repeater.DataSource assign. 
+       This fixes bug #52179.
+
 2003-12-15  Alon Gazit <along@mainsoft.com>
        * DataGrid.cs: Change the implementation of the property 
        BackImageUrl. The current implementation has no influence 
index 21cd3184efc64173eb1aeb23113a1ac7fd439b42..9dfd4c4a74a3edd5f54696cab28790cf45aaeb58 100644 (file)
@@ -314,11 +314,11 @@ namespace System.Web.UI.WebControls
                                        ds = new DataSourceInternal (itemCount);
                        }
 
-                       if (headerTemplate != null)
-                               CreateItem (-1, ListItemType.Header, useDataSource, null);
-
                        int index = 0;
-                       if (ds != null) {
+                       if (ds != null) {\r
+                               if (headerTemplate != null)
+                                       CreateItem (-1, ListItemType.Header, useDataSource, null);
+                               
                                bool even = true;
                                foreach (object item in ds){
                                        if (separatorTemplate != null && index > 0)
@@ -336,12 +336,12 @@ namespace System.Web.UI.WebControls
                                        itemsArrayList.Add (repeaterItem);
                                        index++;
                                        even = !even;
-                               }
+                               }\r
+                               \r
+                               if (footerTemplate != null)
+                                       CreateItem (-1, ListItemType.Footer, useDataSource, null);
                        }
 
-                       if (footerTemplate != null)
-                               CreateItem (-1, ListItemType.Footer, useDataSource, null);
-
                        if (useDataSource)
                                ViewState [ITEMCOUNT] = (ds == null) ? -1 : index;
                }