| |||||
Adding Sorting to a DataGrid ControlControls You Can Use on Web Forms ASP.NET Data Controls DataGrid Control The DataGrid Web server control provides a way for you to add sorting to the grid using these methods:
In either case, the grid does not sort the rows. Instead, it notifies you of the sort request by raising an event. You then perform the sort in your own code, usually by passing rebinding to the data source with new sort parameters. Specifying Default SortingTo use default sorting, you set properties of the DataGrid control to enable sorting for all columns. You then create an event-handling method to perform the sort. To specify default sorting
Specifying Custom SortingYou can define custom sorting by including bound columns and template columns in the grid. To specify custom sorting
If you include template columns, you can specify what type of button users click in the column heading to indicate that they want to sort that column. To include a graphic that users click to sort, use the ImageButton control. To specify a button type for sorting
Performing the SortTo perform the actual sorting, you write logic to respond to the user's sort request. To respond to a sort request
See Also
|
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note