RadGridView scroll position reset after Rebind() for WinForms

2 posts, 0 answers
  1. Joseph
    Joseph avatar
    9 posts
    Member since:
    Jun 2007

    Posted 01 Jul 2015 Link to this post

    This is a question specifically for WinForms but the question is the same as below: 


    Basically, what object and parameters do I have to access within the RadGridView to get my scroll position, so that I can reset it to that position after a rebind.

  2. Stefan
    Stefan avatar
    2906 posts

    Posted 02 Jul 2015 Link to this post

    Hello Joseph,

    Here you are:
     RadScrollBarElement vScroll = radGridView1.TableElement.VScrollBar;
     int position = vScroll.Value;
     bool isMaxValue = position == vScroll.Maximum - vScroll.LargeChange + 1;
     if (position > 0)
         if (isMaxValue)
             position = vScroll.Maximum - vScroll.LargeChange + 1;
         radGridView1.TableElement.VScrollBar.Value = position;

    I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.

    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