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

Grid Loading Time

1 Answer 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Iedoc
Top achievements
Rank 1
Iedoc asked on 26 Nov 2013, 04:08 PM
I'm wondering if i could find some suggestions here.

I have a radgrid with a couple thousand items. I need to process each of these items (on each time the page is loaded) and filter based on their processed status. Currently i load in a collection, process each item, remove items from the collection if needed, then bind it to the grid. in the item data bound event i update the item to show the processed status of that item.

Processing an item takes time, and processing thousands of items takes up to a minute or two. If i could just process the items in the item data bound event, then i would only be processing the items on the current page. Is there any way to remove an item from the item data bound and pull in another item from the next page? I need to keep the pages consistent so i need to keep 20 items (or whatever they choose per page) on the page.

If this is too hard to understand what i mean, i could try explaining again with an example if needed

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 29 Nov 2013, 12:23 PM
Hi Iedoc,

Could you please clarify what exactly do you mean by processing an item? Does some kind of data manipulations are being carried out?

As for removing an item in the ItemDataBound event and pulling another one from the next page I am afraid that this is not possible. The reason for this is that in order to delete an item from the grid you should remove it from the data source to which it is bound and call RadGrid.Rebind(). Rebinding the grid in the OnItemDataBound event however may cause in some scenarios an infinite recursion. That said I would recommend removing the item in the PreRender event and then issuing a rebind. This will force the control to again fire the OnItemDataBound event thus allowing you to execute the logic placed in the event handler.

Regards,
Angel Petrov
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
Tags
Grid
Asked by
Iedoc
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or