| |||||||||||||
DataGrid.SortCommand EventSystem.Web.UI.WebControls Namespace DataGrid Class Occurs when a column is sorted. [ VB ] Public Event SortCommand As DataGridSortCommandEventHandler [ C# ] public event DataGridSortCommandEventHandler SortCommand; [ C++ ] public: __event DataGridSortCommandEventHandler* SortCommand; In [ JScript ], you can handle the events defined by a class, but you cannot define your own. RemarksThe SortCommand event is raised whenever any of the LinkButton controls used for sorting a DataGrid is clicked. Event DataThe method assigned to handle the event is passed an argument of type DataGridSortCommandEventArgs object containing data related to this event. The following DataGridSortCommandEventArgs properties provide information specific to this event.
ExampleThe following code snippets demonstrate how to specify and code a handler for the SortCommand event to enable sorting in a DataGrid control. The below code shows how to designate a handler for the SortCommand event at design time. Note that the AllowSorting property must be set for sorting to be enabled. <asp:datagrid id = "myGrid" runat = "server" ... allowsorting onSortCommand = "sortGrid" /> The below shows the typical code for the SortCommand handler.
See AlsoDataGrid Members DataGridSortCommandEventArgs DataGridSortCommandEventHandler |
| ||||||||||||
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
You can help support aspxtreme