hierarchical grid disappears on expand

4 posts, 0 answers
  1. Jonathan Medley
    Jonathan Medley avatar
    11 posts
    Member since:
    Feb 2008

    Posted 28 May 2008 Link to this post

    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?

  2. Vlad
    Vlad avatar
    11100 posts

    Posted 29 May 2008 Link to this post

    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,
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 29 May 2008 Link to this post


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

  4. Jonathan Medley
    Jonathan Medley avatar
    11 posts
    Member since:
    Feb 2008

    Posted 29 May 2008 Link to this post


    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.


    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,
Back to Top