I've the following nested Grid structure.
<telerik:RadGrid ....>
<MasterTableView...>
<DetailTables>
<GridTableView Name="Users".....>
<Columns>
<telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Status" AllowFiltering="false" />
</Columns>
<NestedViewTemplate>
...................
</NestedViewTemplate>
</GridTableView>
</DetailTables>
<Columns>
............
</Columns>
</MasterTableView>
</telerik:RadGrid>
I want to hide the NestedViewTemplate if "Status" has some specific value.
I'm binding the DetailTable as follows and probably can access the current item's Status value in the same event but not sure how to do that.
protected void RadGridTest_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "Users":
{
int testID = Convert.ToInt32(dataItem.GetDataKeyValue("ID"));
e.DetailTableView.DataSource = UserInTest.GetUsersInTest(testID,"Untaken");
break;
}
}
}
So, how can I access the current item's Column values of DetailTable and the NestedViewTemplate to hide it if the column (Status) has a certain value.
<telerik:RadGrid ....>
<MasterTableView...>
<DetailTables>
<GridTableView Name="Users".....>
<Columns>
<telerik:GridBoundColumn UniqueName="Status" DataField="Status" HeaderText="Status" AllowFiltering="false" />
</Columns>
<NestedViewTemplate>
...................
</NestedViewTemplate>
</GridTableView>
</DetailTables>
<Columns>
............
</Columns>
</MasterTableView>
</telerik:RadGrid>
I want to hide the NestedViewTemplate if "Status" has some specific value.
I'm binding the DetailTable as follows and probably can access the current item's Status value in the same event but not sure how to do that.
protected void RadGridTest_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "Users":
{
int testID = Convert.ToInt32(dataItem.GetDataKeyValue("ID"));
e.DetailTableView.DataSource = UserInTest.GetUsersInTest(testID,"Untaken");
break;
}
}
}
So, how can I access the current item's Column values of DetailTable and the NestedViewTemplate to hide it if the column (Status) has a certain value.