* RepeatInfo.cs: When doing horizontal rendering use the repeat
authorJackson Harper <jackson@novell.com>
Tue, 4 Nov 2003 05:22:38 +0000 (05:22 -0000)
committerJackson Harper <jackson@novell.com>
Tue, 4 Nov 2003 05:22:38 +0000 (05:22 -0000)
columns as the number of columns in a row. This fixes bug
#49016.

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

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

index 02b65fe357ce96912d51aa0bee1db4741da1d73f..f5a368f243da9c764534ffaf0fae31b743dc0d78 100644 (file)
@@ -1,3 +1,8 @@
+2003-11-03 Jackson Harper <jackson@ximian.com>
+
+       * RepeatInfo.cs: When doing horizontal rendering use the repeat
+       columns as the number of columns in a row. This fixes bug #49016.
+       
 2003-11-03 Jackson Harper <jackson@ximian.com>
 
        * PagedDataSource.cs (PageCount): Return page count of 1 if there
index 79ad32eb23d1ec9c1589c26a623b95ff66b2606b..5177c6bfd46c4b3d66174035ce6a3c97f33d8322 100644 (file)
@@ -266,11 +266,8 @@ namespace System.Web.UI.WebControls
                {\r
                        /* Based on DoVerticalRendering */\r
                        int total = user.RepeatedItemCount;\r
-                       int colsCount = repeatColumns;\r
+                       int colsCount = 0;\r
                        int rowsCount = 0;\r
-\r
-                       if (colsCount == 0)\r
-                               colsCount = total;\r
                        WebControl ctrl = null;\r
                        bool isTable = true;\r
                        bool hasSeps = user.HasSeparators;\r
@@ -336,13 +333,23 @@ namespace System.Web.UI.WebControls
                                        if (isTable)\r
                                                writer.RenderEndTag ();\r
                                }\r
-                               rowsCount++;\r
-                               if (rowsCount == total || index == (total - 1)) {\r
+\r
+                               colsCount++;\r
+                               if (colsCount == repeatColumns) {\r
+                                       if (isTable) {\r
+                                               writer.RenderEndTag ();\r
+                                               writer.RenderBeginTag (HtmlTextWriterTag.Tr);\r
+                                       }\r
+                                       else if (rowsCount < total)\r
+                                               writer.WriteFullBeginTag ("br");\r
+                                       colsCount = 0;\r
+                               }\r
+\r
+                               if (index == (total - 1)) {\r
                                        if (isTable)\r
                                                writer.RenderEndTag ();\r
                                        else if (rowsCount < total)\r
                                                writer.WriteFullBeginTag ("br");\r
-                                       rowsCount = 0;\r
                                }\r
                        }\r
 \r