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

Conditionally hide/disable NestedViewTemplate

1 Answer 141 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Petr
Top achievements
Rank 1
Petr asked on 25 Sep 2012, 07:35 PM
Hi,

is it possible to completely hide particular NestedViewTemplate according to specific DataItem.Property? ..or to disable expanding functionality of the item at all?

Thanks,
Petr

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Sep 2012, 06:46 AM
Hi,

I suppose you want to hide nestedviewtemplate based on the text. Here is the sample code.
C#:
protected void RadGrid1_PreRender(object sender, EventArgs e)
{
  foreach (GridDataItem item in RadGrid1.Items)
 {
    if (item["UniqueName"].Text == "text")
    {
       GridNestedViewItem nesteditem = (GridNestedViewItem)RadGrid1.MasterTableView.GetItems(GridItemType.NestedView)[0];
       nesteditem.Visible = false;
     }
  }
}

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