Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1140
WebGrid sorting without clicking column headers
posted

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.

  • 8680
    posted

    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.UltraGridColumn
    col = 
    UltraWebGrid1.Bands(0).Columns.FromKey("CustomerId")
    col.SortIndicator = Infragistics.WebUI.UltraWebGrid.SortIndicator.Ascending
    UltraWebGrid1.Bands(0).SortedColumns.Add(col,
    True)

     

  • 538
    posted

    Hi,

    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