This is a migrated thread and some comments may be shown as answers.

Load Page On Demand

3 Answers 217 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Leandro
Top achievements
Rank 1
Leandro asked on 04 May 2015, 03:11 PM

Good Morning,

I have a gridview that loads some info about products in an unbound manner. I am using paging so I load only a handful at a time to quicken the loading process(because it really takes a long time to load many lines at once since there are some image getting/network traffic involved). But when I use paging, the grid still takes forever to load all pages before being usable. Is there anyway to load pages on demand? By on demand I mean click on the number of a page and load only the items that show on that page.

What I tried so far:

foreach (ECommerceDTS.PRODUCTSRow row in eCommerceDTS.PRODUCTS.Skip(radGridView1.GridViewElement.PagingPanelElement.ZIndex * PAGE_SIZE).Take(PAGE_SIZE))
{
    productEcomm = new ProductEcommerce(row);
    listProducts.Add(productEcomm);
    i++;
}

This works wonderfully loading only PAGE_SIZE items. The problem is that it loads only the first page, and the grid doesn't show other buttons to go to page 2. Is there any workaround this? Maybe hardsetting the number of buttons to show even if there are no items loaded?

Another question: Am I right to assume that ZIndex of the PagingPanelElement means the index of the selected page?

 

Thanks in advance. Kind Regards,

Leandro

3 Answers, 1 is accepted

Sort by
0
Leandro
Top achievements
Rank 1
answered on 04 May 2015, 03:17 PM

I want something like this:

http://demos.telerik.com/aspnet-ajax/grid/examples/functionality/scrolling/scrolling/defaultcs.aspx

But for WinForms...

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 07 May 2015, 09:20 AM
Hello Leandro,

Thank you for writing.

When using paging RadGridView still needs the whole data source in order to calculate the necessary information e.g. how many pages you need. In order to improve performance you can use Virtual mode instead. However, it does not support paging.

Load on demand functionality is available for populating hierarchical grid. However, it is a reasonable request to have it for pages. I have logged it in our feedback portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - feedback item.

I have also updated your Telerik points.

You can construct a UserControl with several buttons indicating the page number. When a certain button is clicked you can repopulate the RadGridView with the relevant subset of data.

As to your second question it seems that you need pinned columns. Please refer to our Pinning and Unpinning Columns help article. 

I hope this information helps. Should you have further questions, I would be glad to help.
 
Regards,
Dess
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Quicken support
Top achievements
Rank 2
answered on 30 Oct 2017, 09:51 AM
Nice code i love it and also very much helpful for many..
Tags
GridView
Asked by
Leandro
Top achievements
Rank 1
Answers by
Leandro
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Quicken support
Top achievements
Rank 2
Share this question
or