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

hierarchical grid disappears on expand

3 Answers 119 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Jonathan Medley
Top achievements
Rank 1
Jonathan Medley asked on 28 May 2008, 04:22 PM
I have a hierarchical grid built programatically on a user control. The user control is loaded dynamically into a content page. I need the user to select data from a combo box and then click a search button (combo box and button are on same user control as thr RadGrid). The button calls a web service which returns a DataSet containing DataTables which I then use as DataSources for my master/detail tables. The data coming back is okay and the grid displays the 'plus' symbols beside each row indicating there is detail data ready to expand, however, when I click the 'plus' the RadGrid disappears. I think the content page is doing a postback and reloading the user control thus resetting the user control to its original state. I can get the RadGrid to work by using just a plain aspx and doing all the RadGrid setup in the PageLoad and checking for IsPostBack == false. Any suggestions on how to retain the RadGrid when expanding the grid or what I'm missing?

Thanks

3 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 29 May 2008, 05:16 AM
Hello Jonathan,

Most probably the grid is not recreated or is not bound on subsequent post-back event. Can you verify this using the debugger?

All the best,
Vlad
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Princy
Top achievements
Rank 2
answered on 29 May 2008, 10:48 AM
Hi,

You can also have a look at the following demo link.
Creating hierarchy programmatically

Princy.
0
Jonathan Medley
Top achievements
Rank 1
answered on 29 May 2008, 12:36 PM
Vlad,

Yes that is what's happening - the grid is not being recreated. I dynamically load the ascx containing the grid into an aspx. The grid is populated from a button click event so I'm building the grid then, not in PageLoad or PageInit. The aspx containing the ascx does a postback, reloads the ascx and I assume since the grid was built after PageLoad/Init then it's not recreated. So, I'll try to define the grid structure either statically or in the PageLoad/Init.

Princy,

I've been able to reproduce that demo myself, however, my requirements are a little different. I need to use data in a combo box on the ascx as a parameter for my data source and to make things more fun I'm getting my data from a web service. So, I think I'll try building the grid structure statically and use an ObjectDataSource for each level of the grid that returns a DataSet or DataTable.

Thanks Vlad and Princy for your help,
Jonathan
Tags
Grid
Asked by
Jonathan Medley
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Princy
Top achievements
Rank 2
Jonathan Medley
Top achievements
Rank 1
Share this question
or