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

Associating Unique Data with a Grid (not rows)

2 Answers 29 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Christopher
Top achievements
Rank 1
Christopher asked on 06 Aug 2010, 04:00 PM
I have some Rad Data Grids in a DataList that I am using to create a variable number of grids on the page.
All these grids are loaded on the client side using page methods that are called in pageLoad method.  This works for the most part, but in certain cases when there are a large number of grids on the page (more than 50 or 60) too much data is returned and the script stops running. 

In order to remedy this, I'm trying to use the OnGridCreated even to load the grid specific data one at a time, instead of loading up all the Grids at once.  Is there a property that I can use as sort of a bag of data accessible on the client side before the rows are bound, so I can store any arguments I need for the client side call?  ClientDataKeys looks promising, but the data might always be dynamic.

What's the recommended way to do this?

2 Answers, 1 is accepted

Sort by
0
Tsvetoslav
Telerik team
answered on 11 Aug 2010, 03:36 PM
Hi Christopher,

You can use the call back mechanism of RadGrid's client-side binding in order to achieve this scenario. I have demonstrated this approach in the attached sample for two grids on the page, but you can easily extend it for more RadGrid controls.

Hope it helps.

Regards,
Tsvetoslav
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Christopher
Top achievements
Rank 1
answered on 11 Aug 2010, 08:39 PM
Thanks, I'll take a look at this.

I ended up doing a very hacky work around:
I created a <span runat="server" ID="GridNameLoadData" style="display:none"> control for each grid in the repeater, then in the OnGridCreated event i did this


OnGridCreated(sender, args)
{
    var gridId = grid.get_id();
    var gridArgsId = String.format("#{0}LoadData", gridId);
    var argValues = $(gridArgsId).text();
      //load data here
}


It worked, but as you can see it's quite ugly.
Tags
Grid
Asked by
Christopher
Top achievements
Rank 1
Answers by
Tsvetoslav
Telerik team
Christopher
Top achievements
Rank 1
Share this question
or