Print Page | Close Window

A sorting of a GridView example

Printed From: IdeaBlade
Category: DevForce
Forum Name: DevForce Classic
Forum Discription: For .NET 2.0
URL: http://www.ideablade.com/forum/forum_posts.asp?TID=287
Printed Date: 12-Jun-2026 at 4:19am


Topic: A sorting of a GridView example
Posted By: Customer
Subject: A sorting of a GridView example
Date Posted: 16-Jul-2007 at 2:16pm
I understand your sample but the problem is not in getting it to initially sort.  Its to get it to sort when I select a column header and toggle between asc/desc as I select the different headings.  Your example describes a hard coded sort that I can set as the default value.



Replies:
Posted By: IdeaBlade
Date Posted: 16-Jul-2007 at 2:16pm
Perhaps, you can hook into the Sorting event of the GridView.
 
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorting.aspx - http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.sorting.aspx
 
GridView.Sorting Event 
 
Occurs when the hyperlink to sort a column is clicked, but before the http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.aspx - GridView control handles the sort operation.

Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)

BTW, if you find that the DevForceDataSource can not implement some functionality that is possible in the ObjectDataSource, let me know, and I'll try to implement the missing functionality



Print Page | Close Window