Question

I have a DevExpress Grid View with 3000 lines and each line has 10 as detail (it means when the grid load I have 30000 items to load)

It takes a long time to load all of the data, so is there any way to show for example 100 line, and when the user use the automatic filter I show the desired rows?.

Example http://demos.devexpress.com/aspxgridviewdemos/filtering/filterrow.aspx

I tried to use the Skip and Take (using LINQ) but it's not really what I'm looking for, in addition to that I would like to use the automatic filter of the grid.

public static BindingList<patient> getObjectUsingLinq(string sql = "", int skipCount  = 0, int takeCount = 0)
        {
            var gsData = GetDataContext();
            var query = (from q in gsData.patient 
                        orderby q.nom 
                        select q);

            return new BindingList<patient>(LinqHelper.DoSortPaginate(query, "", skipCount, takeCount).ToList());

        }

and to bind this to the Grid I call

listPatient = Patients.getObjectUsingLinq();
myGrid.DataSource = listPatient ;
Was it helpful?

Solution

If you need to display a large amount of records in a GridControl, you can use server data-binding modes (synchronous or asynchronous). These are specifically designed to work with large sets of data consisting of more than 50,000 records.
Take a look at Server Mode concepts to start with these modes.
With XtraGrid and LINQ you can start from here:
Server Mode: Binding to a Data Source Using 'LINQ to SQL Classes'

P.S. The Data Source Configuration Wizard simplifies the process of binding a data-aware DevExpress control (such as GridControl) to a data source

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top