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

ReBind - Not Firing NeedDataSource

3 Answers 304 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Brian Mains
Top achievements
Rank 1
Brian Mains asked on 04 Feb 2009, 07:04 PM
Hello,

My page binds data initially to the RadGrid, but then a change in something should cause the RadGrid to bind again.  I was calling the RadGrid's Rebind() method to bind again, but it's not firing NeedDataSource event...  why is that?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 05 Feb 2009, 05:24 AM
Hi Brian,

Are you binding the Grid using DataSourceID or setting the DataSource in the code behind ? Rebind will be firing NeedDataSource event if the databinding logic for the Grid is placed inside this event.

Shinu.
0
Brian Mains
Top achievements
Rank 1
answered on 05 Feb 2009, 10:20 AM
Hey,

DataSource from the code-behind.  It seems as if I have to set:

RadGrid1.DataSource = null;
RadGrid1.Rebind();

To rebind the grid; otherwise, NeedDataSource doesn't fire.  And I do bind in Rebind.
0
-DJ-
Top achievements
Rank 1
answered on 16 Feb 2009, 02:36 PM
I'm facing a similar problem. Rebind seems to fire or not fire at will.

I have a grid bound in the needdatasource event. I can then filter the grid using a treeview in a combobox, call the rebind where the select string is then changed. This works fine.

I then have a button which clears the tree (clear filter) and calls rebind, but in this case nothing happens.

RadGrid1.DataSource = Nothing - works as you said Brian, thanks.

Regards,
-DJ-
Tags
Grid
Asked by
Brian Mains
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Brian Mains
Top achievements
Rank 1
-DJ-
Top achievements
Rank 1
Share this question
or