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

Updating Hierarchial Grids

1 Answer 14 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 14 May 2012, 06:12 PM
I have a hierarchical grid updating data using item command. The first grid is working like a charm, but there is issue with updation of the child grid. I guess the update command is the same for both the parent and the child grid. But it is not working. Please help me with updating data in hierarchical grid.
Thanks in advance
savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 15 May 2012, 05:12 AM
Hi Savyo,

If you are updating both the Parent and the Child RadGrid in the ItemCommand event, you have to check for one more condition. Please try the following code snippet. Set the Name property for the MasterTableView as well as GridTableView.

ASPX:
<MasterTableView Name="Master">
. . .
<DetailTables>
      <telerik:GridTableView Name="Detail" >
. . .

C#:
protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
{
  if(e.CommandName == RadGrid.UpdateCommandName && e.Item.OwnerTableView.Name == "Master")
  {
      // Update the First RadGrid
  }
  if(e.CommandName == RadGrid.UpdateCommandName && e.Item.OwnerTableView.Name == "Detail")
  {
      // Update the Second RadGrid
  }
}

Hope this helps.

Regards,
Shinu.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or