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

go through all the rows in RadGridView and ChildTemplates

2 Answers 163 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Fernando Moragrega
Top achievements
Rank 1
Fernando Moragrega asked on 16 Sep 2010, 09:13 AM
New to Telerik. I need to go through all the rows of my RadGridView, including ChildGridViewTemplates and change the content of a particular cell automatically.

Thanks 

2 Answers, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 21 Sep 2010, 02:46 PM
Hi Fernando Moragrega,

Thank you for your writing.
Please refer to the following code snippet, which will help you with iterating through all the rows of RadGridView:
 
foreach (GridViewDataRowInfo dataRow in this.GetAllRows(this.radGridView1.MasterTemplate))
{
     //do something
}
 
public List<GridViewRowInfo> GetAllRows(GridViewTemplate template)
{
    List<GridViewRowInfo> allRows = new List<GridViewRowInfo>();
 
    allRows.AddRange(template.Rows);
 
    foreach (GridViewTemplate childTemplate in template.Templates)
    {
        List<GridViewRowInfo> childRows = this.GetAllRows(childTemplate);
        allRows.AddRange(childRows);
    }
 
    return allRows;
}

A bit off topic, please ask the person who has purchased our controls in your company to add you as a License Developer to the purchase. This will give you full access to the products your company has purchased, to our downloads section, and to our support ticketing system. Additionally, all your questions will be reviewed according to the license you have. More information on License Developers you can find here: www.telerik.com/account/faqs.aspx.

I hope you find this information helpful. If there is anything else I can assist you with, do not hesitate to contact me.

Regards,
Stefan
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
0
Fernando Moragrega
Top achievements
Rank 1
answered on 30 Sep 2010, 11:17 AM
Thanks. Perfect
Tags
GridView
Asked by
Fernando Moragrega
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Fernando Moragrega
Top achievements
Rank 1
Share this question
or