Hi,
We need to sort the contents of the grid based on any column without clicking on the column header. We want to call the sort action from a button click event.
Please let me know how to achieve this.
Thanks in advance.
With Regards,
JG Giridhar.
You could re-bind the grid in your button_click event handler, and implement your sorting when you get to the subsequent Grid.DataBinding event handler:
UltraWebGrid1.Bands(0).SortedColumns.Clear()Dim col As Infragistics.WebUI.UltraWebGrid.UltraGridColumncol = UltraWebGrid1.Bands(0).Columns.FromKey("CustomerId")col.SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.AscendingUltraWebGrid1.Bands(0).SortedColumns.Add(col, True)
Execute a query with a sort clause on the database, or work with a dataview when you are using a dataset. Afterwards just rebind the datagrid to that new result.
Hope this helps...
Peter