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

access colum of childtemplate

1 Answer 115 Views
GridView
This is a migrated thread and some comments may be shown as answers.
rahul uttekar
Top achievements
Rank 1
rahul uttekar asked on 31 Mar 2010, 03:31 PM
i  am using radgridview with tabbedchildview.

 i want to access  column of corresponding  childviewtemplate for  parent template's  current selected  row.
 i want code snippet for it .

thanks and regrads,
rahul uttekar.

1 Answer, 1 is accepted

Sort by
0
Julian Benkov
Telerik team
answered on 06 Apr 2010, 11:48 AM
Hi rahul uttekar,

You can get and use child rows and columns using this code snippet:
 

private void radButton1_Click(object sender, EventArgs e)
{
    GridViewRowInfo[] rows = this.radGridView1.MasterGridViewTemplate.ChildGridViewTemplates[0].GetChildRows(
        this.radGridView1.MasterGridViewTemplate.Rows[0]);
 
    if (rows != null && rows.Length > 0)
    {
        foreach (GridViewDataColumn col in this.radGridView1.MasterGridViewTemplate.ChildGridViewTemplates[0].Columns)
        {
            foreach (GridViewDataRowInfo row in rows)
            {
                row.Cells[col.Index].Value = "Test"; //set value....
            }
        }
    }
}

 Regards,

Julian Benkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
rahul uttekar
Top achievements
Rank 1
Answers by
Julian Benkov
Telerik team
Share this question
or