Sure you can.
Just, as with other EventHandlers, add some code like this to the InitializeComponent method:
myDataGrid.SortCommand += new DataGridSortCommandEventHandler(this.SortCommand);
Alternatively, you can switch to Design View, have VS.NET screw up all your HTML, then click your DataGrid once. On the Properties dialog, switch to the Events category, locate the SortCommand entry, type a new method name and hit Tab. VS.NET will add the Handler and the method for you in the Code Behind.
What's wrong with changing the HTML? I find this a useful and quick way to setup multiple handlers in Code View of the page.....
Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.
|