Determining first visible row

2 posts, 0 answers
  1. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 07 Sep 2007 Link to this post

    I have a table bound to a datasource that updates or gets changed frequently.  The actual number of rows does not change that much or very little.  The user will scroll through the table to look at various rows, but when the table refreshes, it always causes the grid to scroll back to the top row.  I would like the visible rows to not scroll out of view.

    One thought was to save off the current top visible row index and the then scroll to it after an update, but I can't seem to find out what it is.

    If you have another solution as well that would be great.

  2. Jack
    Admin
    Jack avatar
    2335 posts

    Posted 10 Sep 2007 Link to this post

    Hi johns,

    We will fix this issue in the upcoming Q2 release later this month. Yes, you can save/restore the current top visible row index by getting it from grid vertical scrollbar. Use this code:

    GridVScrollBar vscrollbar = (GridVScrollBar)((GridTableElement)this.radGridView1.GridElement).Children[3];
    int firstVisibleRow = vscrollbar.Value;

     
    Sincerely yours,
    Jack
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top