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

Select a Cell programmatically in Hierarchical Grid

3 Answers 151 Views
GridView
This is a migrated thread and some comments may be shown as answers.
xclirion
Top achievements
Rank 1
xclirion asked on 13 Dec 2010, 01:38 PM
Hi,

we built a hierarchical grid in our application which may contain more than one child views in the same hierarchy level. Below that grid is some kind of raw data displayed. So when a user clicks somewhere in the rawdata we calculate in which view of the grid an in which row/column the the data lies and we want to select this cell by code.

This works so far for the MasterView and the first ChildView. But not for the second or any higher Childview. Is there any sample code how to do this. We have added some kind of a linenumber which gives us a unique row index over all childviews and the line will be found. The main problem is to bring the right childview to the front.

Thanks for your help,
Michael

3 Answers, 1 is accepted

Sort by
0
Richard Slade
Top achievements
Rank 2
answered on 13 Dec 2010, 03:19 PM
Hi Michael, 

I'm a little unsure of what you want to do, but I think you want to get to a row / cell and select it, even if it is a child row in a hierarchy grid. Is that right? 

If so, you can select a row in this way
Me.RadGridView1.CurrentRow = Me.RadGridView1.Rows(0).ChildRows(0)
This would select the first row, below the first row. I.e The first child row of the first row in the grid. 
You can also select a cell in that row
Me.RadGridView1.Rows(0).ChildRows(0).Cells(0).IsSelected = True

hope that helps
Richard
0
xclirion
Top achievements
Rank 1
answered on 15 Dec 2010, 10:18 AM
Hi Richard,

ok, after some testing the problem is not the selection. The problem is to activate the right child view. So if its the second or third childview the correct cell is selected but the childview gets not activated. If I switch manually to the right childview than I see that the correct cell is selected.

Thanks for your help
Michael

0
Svett
Telerik team
answered on 16 Dec 2010, 11:47 PM
Hi Michael,

I am not able to reproduce the issue with the presented information. We will appreciate it if you open a support ticket with an attached project where the issue occurs. This will help us to investigate it locally and provide you with further assistance.

Best wishes,
Svett
the Telerik team
Check out the Q1 2011 Roadmap for Telerik Controls for Windows Forms.
Tags
GridView
Asked by
xclirion
Top achievements
Rank 1
Answers by
Richard Slade
Top achievements
Rank 2
xclirion
Top achievements
Rank 1
Svett
Telerik team
Share this question
or