I have tried the following code on prerender, itemcreated, item databound events of the grid.It does not show the nested view but still displays the caret symbol which I don't need.
Is there a way to hide the template including the caret symbol?
Prerender:
foreach (GridDataItem item in Grd.Items)
{
if (chk != "1")
{
GridNestedViewItem nesteditem = (GridNestedViewItem)Grd.MasterTableView.GetItems(GridItemType.NestedView)[0];
nesteditem.Visible = false;
nesteditem.Enabled = false;
nesteditem.Display = false;
}}
OnItemcreated
protected void OnGrd_ItemCreated(object sender, GridItemEventArgs e)
{
if (e.Item is GridNestedViewItem)
{
GridNestedViewItem nestedItem = (GridNestedViewItem)e.Item;
var chk = "1";
if (chk != "1")
{
nestedItem.Visible = false;
}}}
OnItemDataBound:
if ((e.Item is GridNestedViewItem))
{var p= e.Item.FindControl("GrdNest") as RadGrid;
{chk="1";
if (chk == "1")
{nestedItem.Visible = true;
p.Visible = true;
p.DataSource = results;
p.DataBind();
}
else
{
nestedItem.Visible = false;
nestedItem.Display = false;
p.Visible = false;
}}}