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

Selecting-rows-and-cells-programmatically

5 Answers 325 Views
GridView
This is a migrated thread and some comments may be shown as answers.
tphan
Top achievements
Rank 1
tphan asked on 16 Feb 2012, 10:11 AM
I am using a hierarchy GridView... How could I select a row inside a childTemplate ?
http://www.telerik.com/help/winforms/gridview-selection-selecting-rows-and-cells-programmatically.html

RadGridView.rows[..]  only can reach to 1 level down.... What if the master template contains many childtemplates... how could I select the any number of rows ?

I am current finding a way to acheive it... please give advice ? Thanks !

5 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 20 Feb 2012, 04:57 PM
Hello Charles,

Thank you for your question.

You can access a row from a child level by accessing it by the ChildRows collections:

this.radGridView1.ChildRows[0].ChildRows[1].IsSelected = true;

Alternatively, you can access a row through the child template of the master template:
this.radGridView1.MasterTemplate.Templates[0].Rows[1].IsSelected = true;

Please note that in order to make a child row selected, the view in which it resides should be opened.

I hope this helps.
Regards,
Nikolay
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
tphan
Top achievements
Rank 1
answered on 20 Feb 2012, 05:07 PM
Thanks Nikolay... I am currently using your 2nd approach... Now I learn from you that I can use approach 1 as well too. Thanks !
0
Nikolay
Telerik team
answered on 23 Feb 2012, 04:05 PM
Hi Charles,

You are welcome. Feel free to write back if you have additional questions.

Greetings,
Nikolay
the Telerik team
RadControls for WinForms Q1'12 release is now live! Check out what's new or download a free trial >>
0
Chamin
Top achievements
Rank 1
answered on 15 Oct 2012, 09:57 AM
Hi Nikolay,

How do I select last row of the RadGridView when having more pages?

Thanks & Best Regards,
CH@MIN.G
0
Nikolay
Telerik team
answered on 17 Oct 2012, 11:15 AM
Hi Chamin,

RadGridView for WinForms does not support paging, so could you please share more details about your scenario? How your RadGridView is set up? If your questions concerns our ASP.NET Ajax suite, please open a new thread in the appropriate forum section.

Thank you for your understanding.

Kind regards,
Nikolay
the Telerik team
You’ve been asking for it and now it’s time for us to deliver. RadControls for WinForms Q3 2012 release is just around the corner. Sign up for a free webinar to see first all the latest enhancements.
Tags
GridView
Asked by
tphan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
tphan
Top achievements
Rank 1
Chamin
Top achievements
Rank 1
Share this question
or