How to sort a column in data grid:
-
How to sort a column in data grid: I want to sort on the column "LoanNumber" In my ASP code shown below, I added AllowSorting property to True, in the DataGrid.Which gives me the hyperlink in the header. In order to have this happen I need to do two things: create a sort event handler and specify the event handler for the DataGrid's sort event. I created the sub SortEventHandler as below but I am lost as to what is next to do? Sub SortEventHandler(sender as Object, e as DataGridSortCommandEventArgs) ... End Sub Private Sub DG1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DG1.SelectedIndexChanged End Sub
-
How to sort a column in data grid: I want to sort on the column "LoanNumber" In my ASP code shown below, I added AllowSorting property to True, in the DataGrid.Which gives me the hyperlink in the header. In order to have this happen I need to do two things: create a sort event handler and specify the event handler for the DataGrid's sort event. I created the sub SortEventHandler as below but I am lost as to what is next to do? Sub SortEventHandler(sender as Object, e as DataGridSortCommandEventArgs) ... End Sub Private Sub DG1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DG1.SelectedIndexChanged End Sub
kenn_rosie wrote:
I created the sub SortEventHandler as below but I am lost as to what is next to do?
You will probally get an answer in the correct form try the Web Devolopment form[^] Good luck :) BTW, if you wanted to sort the data before presenting it to the user use the Order By [column] in your select statement.