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

multiple Rebind in one server call does only once needdatasource

2 Answers 56 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 05 Jul 2010, 10:12 AM
Hello,

I have a grid which is bind through advanced data binding. I run in a code behind method in a loop multiple times grid.rebind(). Unfortunately only the first time NeedDataSource is called. Contrary to this the grid.ItemDataBound is called the same number, I call the rebind method. So what is my mistake, that NeedDataSource is called just once per Postback?

Thanks in advance
Simon

2 Answers, 1 is accepted

Sort by
0
Radoslav
Telerik team
answered on 07 Jul 2010, 12:14 PM
Hi Simon,

To achieve the desired functionality you need to clear the data source of the RadGrid before rebinding it. For example:
for (int i = 0; i < n; i++)
{
   RadGrid1.DataSource = null;
   RadGrid1.Rebind();
}

Please give it try and let me know if the issue still persists.

Regards,
Radoslav
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
Simon
Top achievements
Rank 1
answered on 07 Jul 2010, 01:34 PM
Hello Radoslav,

thanks it worked like a charm.
Simon



Tags
Grid
Asked by
Simon
Top achievements
Rank 1
Answers by
Radoslav
Telerik team
Simon
Top achievements
Rank 1
Share this question
or