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

[Solved] Add Nested Grid to some rows

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Mallikharjun Mulagundla
Top achievements
Rank 1
Mallikharjun Mulagundla asked on 30 Nov 2009, 09:22 AM
Hi,

I need to create Nested Grid to some of the rows(based on DB results of the parent Grid). So, I need to add 'Expand' symbol for some rows only. Please let me know, how proceed on this? It would be great, if you can provide some sample code.

Thanks,
Malli

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 30 Nov 2009, 10:03 AM
Hello Malli

Try the following code snippet in order to hide the expand/collapse image for items those do not have child items in hierarchy.

CS:
 
    protected void RadGrid1_PreRender(object sender, EventArgs e) 
    { 
        foreach(GridDataItem item in RadGrid1.MasterTableView.Items) 
        { 
            if (item.ChildItem.NestedTableViews[0].Items.Count == 0) 
            { 
                item["ExpandColumn"].Controls[0].Visible = false
            } 
        } 
    } 

-Shinu.
Tags
Grid
Asked by
Mallikharjun Mulagundla
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or