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

GridView Hierarchical Scroll To Row

3 Answers 121 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Scott
Top achievements
Rank 1
Scott asked on 27 May 2015, 04:21 PM

I'm using VS 2010 C# Winform. I was wanting to know if its possible to scroll to a specific row in a hierarchical grid like you can with the parent grid?

 Example: this.gridview.TableElement.ScrollToRow(3);

 

3 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 28 May 2015, 03:11 PM
Hello Scott,

Thank you for writing.

The ScrollToRow method is working with hierarchy as well. However you need to pass the row instance directly:
radGridView1.TableElement.ScrollToRow(radGridView1.MasterTemplate.Templates[0].Rows[0]);

Please let me know if there is something else I can help you with. 
 
Regards,
Dimitar
Telerik
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 Feedback Portal and vote to affect the priority of the items
0
Scott
Top achievements
Rank 1
answered on 28 May 2015, 04:54 PM

Thank you for the quick reply. I tried this solution and although I didn't receive any errors I was not able to get it to work for me. I'm still only able to get it to auto scroll to the row of the parent grid. I've copied and pasted the excerpt of my code below along with the definition of the variables used.

Telerik Grid: dgv_edi_apps

file_row_index = the row number of the parent grid

ea_child_rec_id = the row number of the hierarchical grid

 

dgv_edi_apps.TableElement.ScrollToRow(file_row_index);
dgv_edi_apps.Rows[file_row_index].IsExpanded = true;
dgv_edi_apps.TableElement.ScrollToRow(dgv_edi_apps.MasterTemplate.Templates[0].Rows[ea_child_rec_id]);
dgv_edi_apps.MasterTemplate.Templates[0].Rows[ea_child_rec_id].IsSelected = true;

0
Dimitar
Telerik team
answered on 29 May 2015, 11:07 AM
Hi Scott,

Thank you for writing back.

I have created a small test project to show you how this works on my side. To test this start the project and scroll to the bottom. Then press the button and you will notice that the grid is scrolled up to the specified child row. Could you please check the project and let me know how it differs from your real setup?

I am looking forward to your reply.
 
Regards,
Dimitar
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
GridView
Asked by
Scott
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Scott
Top achievements
Rank 1
Share this question
or