Hi all,
How can I disable preloading in the grid?
I am handling the AfterSortChange event on the grid and load one page of data using the ultra data source. Unfortunately once this event fires the data source's CellDataRequested event fires for all rows in the grid, including the ones that are not in view to perform client side sorting. I don't need thisan I would like to turn it off since it loads all the rows and defeats the purpose pf paging in thefirst place.
Thanks!Matei
Hi Matei,
In order to sort the data, the grid has to load all of it. There's no way around that if you want the grid to handle the sorting for you.
What you can do is set the HeaderClickAction to one of the "External" sorting modes.
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { UltraGridLayout layout = e.Layout; UltraGridOverride ov = layout.Override; ov.HeaderClickAction = HeaderClickAction.ExternalSortMulti; }
This will make the grid display a sort indicator on the column header and allow the user to toggle the sort direction, but the grid will not perform any sorting of the data - so you will have to handle the sorting yourself in the Before/AfterSortChange event.
Thanks Mike, that's exactly what I needed. Works as expected, we can handle the sorting manually now on the backend.
Cheers,Matei