Hi all,
I'm having a trouble with a RadGrid and a DataSource.
I'm populating my datasource within the radGrid_NeedDataSource event. I'm using paging and filtering on my grid. I wanted to translate the content of a single column of my grid and I added some code within the NeedDataSource Event, like this (very summarized) :
// Getting the data from a custom CACHE
l_resource = CacheManager.Instance.GetResource(....);
// Translation process and assign dataSource to Grid.
myGrid.DataSource = TranslateDataSource(l_resource);
Due to huge amount of data, and a translation process being a bit slow, I realized that, when changing page, the grid calls again the NeedDataSource event and therefore, get the data and perform the translation process all over again. The problem is that, my query returns more than 100'000 elements and I display only 20 of them on the grid due to paging.
Now, here is what bugs me :
I either should download all the datas ONCE then give them to the data grid and never ask for a new datasource again when passing to a new page of my grid.
This process would give me a slow first load of the page then changing my grid's pages would be very quick...
...Or whenever I want another grid's page to display, I should send the specific informations so my query result is as small as possible. For example 20 items if my paging is 20 items, instead of 100000 items to display 20 items. It would therefore be optimized to display the correct amount of data within my grid.
I'm a bit surprized of this behavior and I would like to know what would be the best way to deal with that kind of problem.
Can you guys help me please ?
Stéphane
I'm having a trouble with a RadGrid and a DataSource.
I'm populating my datasource within the radGrid_NeedDataSource event. I'm using paging and filtering on my grid. I wanted to translate the content of a single column of my grid and I added some code within the NeedDataSource Event, like this (very summarized) :
// Getting the data from a custom CACHE
l_resource = CacheManager.Instance.GetResource(....);
// Translation process and assign dataSource to Grid.
myGrid.DataSource = TranslateDataSource(l_resource);
Due to huge amount of data, and a translation process being a bit slow, I realized that, when changing page, the grid calls again the NeedDataSource event and therefore, get the data and perform the translation process all over again. The problem is that, my query returns more than 100'000 elements and I display only 20 of them on the grid due to paging.
Now, here is what bugs me :
I either should download all the datas ONCE then give them to the data grid and never ask for a new datasource again when passing to a new page of my grid.
This process would give me a slow first load of the page then changing my grid's pages would be very quick...
...Or whenever I want another grid's page to display, I should send the specific informations so my query result is as small as possible. For example 20 items if my paging is 20 items, instead of 100000 items to display 20 items. It would therefore be optimized to display the correct amount of data within my grid.
I'm a bit surprized of this behavior and I would like to know what would be the best way to deal with that kind of problem.
Can you guys help me please ?
Stéphane