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

Telerik Hierarchial Grid

1 Answer 17 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Pardha Saradhi
Top achievements
Rank 1
Pardha Saradhi asked on 23 Oct 2010, 01:09 PM

    Hi,

    Could you please clarify the following query:-   

    How to refresh child record of the hierarchial grid without making the  child to be closed.

    Thanks.
  

 


1 Answer, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 25 Oct 2010, 06:31 AM
Hello Pardha,

In ItemCommand event check whether the DetailTable is refreshing and store the index of parent grid item. Then in Prerender event expand the corresponding Grid Item.

ASPX:
<DetailTables>
       <telerik:GridTableView Name="Detail2" CommandItemDisplay="Top" >
          . . . . . . . . . . . . . . . .  . . . . .            
</DetailTables>

C#:
int parentitemIndex = -1;
  protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
   {
      if ((e.CommandName == "RebindGrid") && (e.Item.OwnerTableView.Name == "Detail2"))
       {
           GridDataItem item = (GridDataItem)e.Item.OwnerTableView.ParentItem;
           parentitemIndex = item.ItemIndex;
       }
    }
  protected void RadGrid1_PreRender(object sender, EventArgs e)
   {
       if (parentitemIndex > -1)
       {
           GridDataItem item = (GridDataItem)RadGrid1.Items[parentitemIndex];
           item.Expanded = true;
       }
   }

Thanks,
Princy.
Tags
Grid
Asked by
Pardha Saradhi
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Share this question
or