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

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 30 Mar 2005 10:24:30 -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 tsureshkumar@novell.com.

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

--- shadow/73864	2005-03-29 17:38:09.000000000 -0500
+++ shadow/73864.tmp.28659	2005-03-30 10:24:30.000000000 -0500
@@ -4,14 +4,14 @@
 OS: All
 OS Details: 
 Status: NEW   
 Resolution: 
 Severity: Unknown
 Priority: Normal
-Component: Sys.Data
-AssignedTo: mono-bugs@ximian.com                            
+Component: Sys.Web
+AssignedTo: tsureshkumar@novell.com                            
 ReportedBy: bugzilla@patearl.net               
 QAContact: mono-bugs@ximian.com
 TargetMilestone: ---
 URL: 
 Cc: 
 Summary: DataGrid.PageCount behaviour inconsistent with MS' .NET
@@ -130,6 +130,36 @@
 
 ------- Additional Comments From bugzilla@patearl.net  2005-03-29 17:38 -------
 It may be worth noting that having a PageCount of one is consistent
 with how the grid operates.  When there are zero items and paging is
 turned on, the list of available pages shows "1".  The page still
 exists, it just has zero items on it.
+
+------- Additional Comments From tsureshkumar@novell.com  2005-03-30 10:24 -------
+sys.web?
+
+possible patch to solve the exception in 2nd example above (Additional
+Comments From Patrick Earl 2005-03-21 17:16):
+
+Index: System.Web.UI.WebControls/DataGrid.cs
+===================================================================
+--- System.Web.UI.WebControls/DataGrid.cs       (revision 41888)
++++ System.Web.UI.WebControls/DataGrid.cs       (working copy)
+@@ -1580,11 +1580,7 @@
+                                                       
+((IDisposable)props).Dispose();
+                                        }
+                                }
+-                               if(retVal.Count > 0)
+-                               {
+-                                       return retVal;
+-                               }
+-                               throw new
+HttpException(HttpRuntime.FormatResourceString("DataGrid_NoAutoGenColumns",
+ID));
++                                return retVal;
+                        }
+                        return null;
+                }
+
+IMHO, no need to check for a column number > 0 , just return the empty
+column array list. A zero element collection needs to be supported.