[Mono-devel-list] [PATCH] Fix "neutral" sorting in DataView

Boris Kirzner borisk at mainsoft.com
Wed Jul 20 11:57:01 EDT 2005


Hello Marc,

I think your patch is fixing the symptom, not the problem.
If you want to fix the problem, you probably should change DataView code 
so it always uses Sort property instead of sort private member (except 
the places this can not be done), and change the Sort get : it should 
return String.Empty if useDefaultSort is true and sort otherwise.

And it would be really gentle if you'll supply a test case for your fix.


Boris

Marc Haisenko wrote:

>Hi folks,
>this simple patch fixes resetting the sorting to default sorting in a 
>DataView. If you set the Sort property to some string and later pass it null, 
>it should revert to "no sorting". But unfortunately the old sort string is 
>still saved and passed to the DataTable. The attached patch fixes this.
>C'ya,
>	Marc
>
>PS: Please don't forget my "Fix parsing of sort strings in DataTable" patch 
>from Monday ;-)
>
>  
>
>------------------------------------------------------------------------
>
>Index: class/System.Data/System.Data/DataView.cs
>===================================================================
>--- class/System.Data/System.Data/DataView.cs	(revision 47468)
>+++ class/System.Data/System.Data/DataView.cs	(working copy)
>@@ -270,6 +270,7 @@
> 				if (value == null) {	
> 				/* if given value is null useDefaultSort */
> 					useDefaultSort = true;
>+					sort = "";
> 					/* if ApplyDefault sort is true try appling it */
> 					if (ApplyDefaultSort == true)
> 						PopulateDefaultSort ();
>  
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Mono-devel-list mailing list
>Mono-devel-list at lists.ximian.com
>http://lists.ximian.com/mailman/listinfo/mono-devel-list
>  
>

-- 
Boris Kirzner
Mono R&D team, Mainsoft Corporation.
Blogging at http://boriskirzner.blogspot.com/





More information about the Mono-devel-list mailing list