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

NeedDataSource - Hierarchical Grid

2 Answers 55 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jako
Top achievements
Rank 1
Jako asked on 14 May 2012, 11:08 AM
Hi there

I have a Hierarchical grid setup and it is working 100%, but now I need to apply filtering on the MasterTable. So I have changed my databinding to use the NeedDataSource event.

The problem is I need to reload the grid based on two external filters (drop downs), so to reload the dataset based on this I set the EnableViewState="false" on the MasterTable, this works fine. Now the problem is that when I do a post back in a child element of the MasterTable it resets as well and I "lose" the focus of the child item I was working on.

Is there a way I can rebind the datasource programmatically when the OnSelectedIndexChanged fires on the drop downs with EnableViewState on the MasterTable Enabled?

2 Answers, 1 is accepted

Sort by
0
Marin
Telerik team
answered on 17 May 2012, 08:46 AM
Hello,

 You do not need to disable the viewstate of the MasterTableView. You can simply force the control to be databound earlier by calling the Rebind() method of the grid - this will execute the NeedDataSource event and the control will bind.

Regards,
Marin
the Telerik team
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 their blog feed now.
0
Jako
Top achievements
Rank 1
answered on 17 May 2012, 02:11 PM
Thanks Marin, that did the trick
Tags
Grid
Asked by
Jako
Top achievements
Rank 1
Answers by
Marin
Telerik team
Jako
Top achievements
Rank 1
Share this question
or