GridView Hierarchical Scroll To Row

4 posts, 0 answers
  1. Scott
    Scott avatar
    2 posts
    Member since:
    Nov 2010

    Posted 27 May 2015 Link to this post

    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);

     

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 28 May 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Scott
    Scott avatar
    2 posts
    Member since:
    Nov 2010

    Posted 28 May 2015 in reply to Dimitar Link to this post

    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;

  5. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 29 May 2015 Link to this post

    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
Back to Top