Przeglądaj źródła

* RepeatInfo.cs: When doing horizontal rendering use the repeat
columns as the number of columns in a row. This fixes bug
#49016.

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

Jackson Harper 22 lat temu
rodzic
commit
41591e12e1

+ 5 - 0
mcs/class/System.Web/System.Web.UI.WebControls/ChangeLog

@@ -1,3 +1,8 @@
+2003-11-03 Jackson Harper <[email protected]>
+
+	* 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 <[email protected]>
 
 	* PagedDataSource.cs (PageCount): Return page count of 1 if there

+ 14 - 7
mcs/class/System.Web/System.Web.UI.WebControls/RepeatInfo.cs

@@ -266,11 +266,8 @@ namespace System.Web.UI.WebControls
 		{
 			/* Based on DoVerticalRendering */
 			int total = user.RepeatedItemCount;
-			int colsCount = repeatColumns;
+			int colsCount = 0;
 			int rowsCount = 0;
-
-			if (colsCount == 0)
-				colsCount = total;
 			WebControl ctrl = null;
 			bool isTable = true;
 			bool hasSeps = user.HasSeparators;
@@ -336,13 +333,23 @@ namespace System.Web.UI.WebControls
 					if (isTable)
 						writer.RenderEndTag ();
 				}
-				rowsCount++;
-				if (rowsCount == total || index == (total - 1)) {
+
+				colsCount++;
+				if (colsCount == repeatColumns) {
+					if (isTable) {
+						writer.RenderEndTag ();
+						writer.RenderBeginTag (HtmlTextWriterTag.Tr);
+					}
+					else if (rowsCount < total)
+						writer.WriteFullBeginTag ("br");
+					colsCount = 0;
+				}
+
+				if (index == (total - 1)) {
 					if (isTable)
 						writer.RenderEndTag ();
 					else if (rowsCount < total)
 						writer.WriteFullBeginTag ("br");
-					rowsCount = 0;
 				}
 			}