Hi Team.
We have a scenario where we want to conditionaly hide the detail tables. Below is our structure and we need to hide the childHeader and childRow.
.aspx
<telerik:RadGrid>
<MasterTableView >
<DetailTables>
<telerik:GridTableView name="Parent">
</telerik:GridTableView >
</DetailTables>
<DetailTables>
<telerik:GridTableView name="ChildHeader">
<DetailTables>
<telerik:GridTableView name="ChildRow">
</telerik:GridTableView >
</DetailTables>
<telerik:GridTableView >
</DetailTables>
</MasterTableView>
</telerik:RadGrid>
.cs
protected void radgrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "ParentRow":
{
//code for parentrow detail table here
}
case "ChildHeader":
{
//code for ChildHeader detail table here
break;
}
case "ChildRow":
{
//code for ChildRow detail table here
break;
}
}
Now, DetailTableDataBind method iterates on each detailTable, Is it possible to remove the detailtable so that it does not even render and code in DetailTableDataBind method for childHeader and childRow does not execute. Right now its erroring when it goes in these case statements.
So the requirement is to hide these detail tables conditionally and not execute the code for child header and chidRow in above case statement
We have a scenario where we want to conditionaly hide the detail tables. Below is our structure and we need to hide the childHeader and childRow.
.aspx
<telerik:RadGrid>
<MasterTableView >
<DetailTables>
<telerik:GridTableView name="Parent">
</telerik:GridTableView >
</DetailTables>
<DetailTables>
<telerik:GridTableView name="ChildHeader">
<DetailTables>
<telerik:GridTableView name="ChildRow">
</telerik:GridTableView >
</DetailTables>
<telerik:GridTableView >
</DetailTables>
</MasterTableView>
</telerik:RadGrid>
.cs
protected void radgrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch (e.DetailTableView.Name)
{
case "ParentRow":
{
//code for parentrow detail table here
}
case "ChildHeader":
{
//code for ChildHeader detail table here
break;
}
case "ChildRow":
{
//code for ChildRow detail table here
break;
}
}
Now, DetailTableDataBind method iterates on each detailTable, Is it possible to remove the detailtable so that it does not even render and code in DetailTableDataBind method for childHeader and childRow does not execute. Right now its erroring when it goes in these case statements.
So the requirement is to hide these detail tables conditionally and not execute the code for child header and chidRow in above case statement