I have done this past by storing the sort options that the user interface has selected or enabled (in a code behind variant) and then pass this to a sort method to change the order of the data then call the DataBind method on the DataGrid. This may not work if the Datagrid has the DataSource Key column set.
Good Luck, JP -----Original Message----- From: Moderated discussion of advanced .NET topics. [mailto:[EMAIL PROTECTED] On Behalf Of Micah Daniels Sent: Tuesday, March 09, 2004 6:46 AM To: [EMAIL PROTECTED] Subject: [ADVANCED-DOTNET] Datagrid sorting Hi. I need to override the default sorting of the Datagrid class. I need to be able to sort according to more than one column, i.e. have a primary,.secondary, tertiarty,..and so on, e.g. so that the DataView.Sort string can look like " Col1 ASC, Col2 DESC,....and so on." It seems that the default sorting of the Datagrid class sets the Sort property according to the latest column sorted,..in my case the last column header clicked on. I need to locate the handler which does this and replace it with my own logic for queing the sort requests so that " Col1 ASC, Col2 DESC,.." results. I do not want to resort according to my policy after it has perfomed its default sort, but replace its sorting altogether. Does anyone have an answer? Thanks Micah =================================== This list is hosted by DevelopMentor(r) http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com =================================== This list is hosted by DevelopMentor� http://www.develop.com Some .NET courses you may be interested in: NEW! Guerrilla ASP.NET, 17 May 2004, in Los Angeles http://www.develop.com/courses/gaspdotnetls View archives and manage your subscription(s) at http://discuss.develop.com
