Hi jayaprad,
u can sort the columns like this:
First set the property-AllowSorting in datagrid like this:
<asp:DataGrid runat="server" id="id"
.............
AllowSorting="True"
OnSortCommand="MySortHandler"
</asp:datagrid>
Then for the column which u want to sort set the expression like this
<asp:BoundColumn DataField="dbField2"
SortExpression="dbField2" />
like here it will be sorted by dbField2
By adding the AllowSorting property to True, the DataGrid, when rendered, will have in its header for each column a hyperlink
Sub MySortHandler(sender as Object, e as DataGridSortCommandEventArgs)
...
'Add the sorting code.
End Sub
I hope this will solve ur problem......
Enter your message below
Sign in or Join us (it's free).