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

Howto hide DetailTables when in edit mode

2 Answers 93 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Colin
Top achievements
Rank 1
Colin asked on 01 Jul 2014, 02:28 PM
Hi,

I have a hierarchical radgrid that is four levels deep.  What I need is that when I go into edit mode for an entry on the third level that item's detail table is hidden.


I have tried setting visible to false on e.Item.OwnerTableView.DetailTables  but that doesn't help.


I am using version 2013.1.220.35

Thanks

Colin

2 Answers, 1 is accepted

Sort by
0
Accepted
Princy
Top achievements
Rank 2
answered on 02 Jul 2014, 08:52 AM
Hi Colin,

I guess you want to hide the currently editing rows DetailTable to be hidden. Please try the following code snippet.

C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
  foreach (GridDataItem item in RadGrid1.EditItems)
  {          
    if (item.HasChildItems && item.OwnerTableView.Name == "TableName")
    {             
      foreach (GridTableView innerDetailView in item.ChildItem.NestedTableViews)
      {              
       innerDetailView.Visible = false;
      }
    }
  }
}

Thanks,
Princy
0
Colin
Top achievements
Rank 1
answered on 02 Jul 2014, 10:43 AM
Many thanks!

That is exactly what I was looking for.

You're a star!

Colin
Tags
Grid
Asked by
Colin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Colin
Top achievements
Rank 1
Share this question
or