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

[Solved] How to Expand and Collapse Nested RadGrid

1 Answer 385 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anantharaman
Top achievements
Rank 1
Anantharaman asked on 19 Apr 2013, 07:28 PM
Hi,

How do I collapse and expand the nested rad grid on click of the radio button onselectedindex change of the MasterGrid view of every row.
For the same I have the radio button onselectindexchange event associated in every row of the MasterGrid and find the child nested grid to bind. The Issue is that I am able to find the child grid and bind it but the child grid is not expanding and collapsing after bind.

Quick response appreciated !

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 22 Apr 2013, 06:17 AM
Hi,

Try the following.
C#:
protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
  {
      RadioButton radio = (RadioButton)sender;
      GridDataItem dataItem = (GridDataItem)radio.NamingContainer;
    GridTableView tablview = (GridTableView)(dataItem).ChildItem.NestedTableViews[0];
     foreach (GridDataItem item in tablview.Items)
     {
         item.Expanded = true ;
         tablview.Rebind();
     }
 }

Thanks,
Shinu
Tags
Grid
Asked by
Anantharaman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or