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
370
Disable preloading in the grid
posted

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

Parents
No Data
Reply
  • 469350
    Verified Answer
    Offline posted

    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.

Children