even if the list supports it if we are empty. This way we avoid an exc
sorting the empty list, and keep the UI compatible with .net.
2009-08-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
svn path=/trunk/mcs/; revision=139347
+2009-08-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
+
+ * DataGrid.cs: When handling mouse down on a column, don't do any sort
+ even if the list supports it if we are empty. This way we avoid an exc
+ sorting the empty list, and keep the UI compatible with .net.
+
2009-08-04 Carlos Alberto Cortez <calberto.cortez@gmail.com>
* DataGrid.cs: In Edit () check we have any row before trying to use
if (ListManager.List is IBindingList == false)
break;
+
+ // Don't do any sort if we are empty, as .net does
+ if (ListManager.Count == 0)
+ return;
ListSortDirection direction = ListSortDirection.Ascending;
PropertyDescriptor prop = CurrentTableStyle.GridColumnStyles[testinfo.Column].PropertyDescriptor;