[Mono-bugs] [Bug 73864][Nor] Changed - DataGrid.PageCount behaviour inconsistent with MS' .NET

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Mon, 21 Mar 2005 17:16:39 -0500 (EST)


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bugzilla@patearl.net.

http://bugzilla.ximian.com/show_bug.cgi?id=73864

--- shadow/73864	2005-03-21 16:10:47.000000000 -0500
+++ shadow/73864.tmp.27215	2005-03-21 17:16:39.000000000 -0500
@@ -94,6 +94,36 @@
   if(CurrentPageIndex >= PageCount) {
     throw new Exception('The current page index must be < PageCount');
   }
 
 Note that I did not confirm this behaviour directly with the MS
 DataGrid class, but only through MxDataGrid.
+
+------- Additional Comments From bugzilla@patearl.net  2005-03-21 17:16 -------
+The following quick test produces 1 for PageCount (0 for Items.Count)
+with Microsoft's .NET implementation:
+
+<%@ Page Language="C#" %>
+<script runat="server">
+    void Page_Load(object sender, EventArgs e) {
+      DataGrid1.DataSource = new ArrayList();
+      DataGrid1.DataBind();
+      Response.Write(DataGrid1.Items.Count);
+      Response.Write(DataGrid1.PageCount);
+    }
+</script>
+<html>
+<head>
+</head>
+<body>
+    <form runat="server">
+        <asp:DataGrid id="DataGrid1" runat="server"></asp:DataGrid>
+    </form>
+</body>
+</html>
+
+The same program run under mono produces an exception, but that's a
+different issue.
+
+System.Web.HttpException: DataGrid_NoAutoGenColumns: DataGrid1
+in System.Web.UI.WebControls.DataGrid:AutoCreateColumns
+(System.Web.UI.WebControls.PagedDataSource)