RadGridView scrolling

14 posts, 0 answers
  1. Shweta
    Shweta avatar
    7 posts
    Member since:
    Jun 2008

    Posted 07 Oct 2008 Link to this post

    hi,

    Can anyone guide me in how to change the scrolling position of the scoll bar of radGridView  by code behind. 

    regards,
    Shewta
  2. Nikolay
    Admin
    Nikolay avatar
    1805 posts

    Posted 08 Oct 2008 Link to this post

    Hi Shweta,

    You can scroll RadGridView programmatically. Just call RadGridView.GridElement.ScrollToRow() method passing as a parameter either the index of the desired row, or the row itself:
    this.radGridView1.GridElement.ScrollToRow(23); 

    If you have additional questions, feel free to contact me.

    Best wishes,
    Nikolay
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Sudip Vidyarthi
    Sudip Vidyarthi avatar
    2 posts
    Member since:
    May 2010

    Posted 17 Aug 2011 Link to this post

    I am unable to scroll to last row smoothly...whenever a new row is added, the scroll bar seems at last position but actualy the data are of not reflecting properly whn updated
  4. Svett
    Admin
    Svett avatar
    728 posts

    Posted 19 Aug 2011 Link to this post

    Hi Sudip Vidyarthi,

    Thanks for writing.

    I am enclosing a sample project which demonstrates how you can scroll to the last row.

    All the best,
    Svett
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

  5. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 23 Apr 2013 Link to this post

    I need to scroll row by row my gridview
    Is there a way when i scroll in the end of the lines to see only the last rows ? (for example, when i am at the last row, i want to see only the last)

    i don't know if you understand what i mean, i don't speak english very well ^^
  6. Svett
    Admin
    Svett avatar
    728 posts

    Posted 24 Apr 2013 Link to this post

    Hello Nermond,

    If you want to perform scrolling row by row, you should change the ScrollMode of RowScoller in the following manner:
    this.radGridView1.TableElement.RowScroller.ScrollMode = ItemScrollerScrollModes.Discrete;

    If you want to see only one row at time in the RadGridView's viewport, you should change its height or shrink the RadGridView's height. You can change the height of all rows by using the following code snippet:
    this.radGridView1.TableElement.RowHeight = 50;

    I hope that you find this information useful.

    Greetings,
    Svett
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  7. QuizzBox
    QuizzBox avatar
    93 posts
    Member since:
    Jan 2011

    Posted 24 Apr 2013 Link to this post

    super, i didn't know "Rowscroller" :)
    In fact, what i need to do is an infinite smooth scroll in the gridview. After the last row, i want to see the first row again, etc....
    you think there's a way ?
  8. Svett
    Admin
    Svett avatar
    728 posts

    Posted 29 Apr 2013 Link to this post

    Hi Nermond,

    There is no way to achieve that. The scrolling in RadGridView is based on the virtualization engine. It is designed to process the rows sequentially until the last one is reached. There is no way to customize this approach.

    Kind regards,
    Svett
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  9. Developer
    Developer avatar
    2 posts
    Member since:
    Aug 2013

    Posted 29 Jul 2014 in reply to Svett Link to this post

    Svett said:Hi Sudip Vidyarthi,

    Thanks for writing.

    I am enclosing a sample project which demonstrates how you can scroll to the last row.

    All the best,
    Svett
    the Telerik team
     

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

     


    This doesn't seem to work if I have added two SortDescriptors to my RadGridView. I suspect the row indexes don't get updated, so that the bottom row ends up not necessarily having the highest index value. Is it possible to programmatically scroll to bottom-most row after sorting has taken place?
  10. Dimitar
    Admin
    Dimitar avatar
    2907 posts

    Posted 01 Aug 2014 Link to this post

    Hello Keith,

    Thank you for writing.

    The provided solution should work for all cases regardless of the rows order. Please note that the ChildRows collection should be used since the indexes in the Rows collection are not changed after the sorting operation. Nevertheless you can use a direct index as well:
    this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);

    I hope this helps.

    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  11. Developer
    Developer avatar
    2 posts
    Member since:
    Aug 2013

    Posted 01 Aug 2014 in reply to Dimitar Link to this post

    Dimitar said:Hello Keith,

    Thank you for writing.

    The provided solution should work for all cases regardless of the rows order. Please note that the ChildRows collection should be used since the indexes in the Rows collection are not changed after the sorting operation. Nevertheless you can use a direct index as well:
    this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);



    Thank You Dimitar,

    But, wouldn't that just take the Count of ChildRows and scroll to the record whose index in Rows matches that count? If the indexes in Rows do not change, I don't think this gets around the issue. 

    I have tried to do this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count - 1), since just using Count would be out of the zero-based index range. But, this is not scrolling all the way to the bottom.

    I believe what I would need to do is to get the last element in ChildRows, and then lookup what that element's index would be in Rows, and use that integer as the parameter in this.radGridView1.TableElement.ScrollToRow(). Can you tell me if that is possible and how to go about it?

  12. Dimitar
    Admin
    Dimitar avatar
    2907 posts

    Posted 05 Aug 2014 Link to this post

    Hi Keith,

    Thank you for writing back.

    This works as expected on my side. In addition the rows indexes in the ChildRows collection should be changed after the grid is sorted. More Information about this collection can be found here. This is why I want to kindly ask you to post a support ticket for this. There you should attach a sample project that reproduces the issue. You can specify the exact version of our controls that you are using as well. This will allow us to further investigate this case and provide you with a proper solution.

    You can also include a reference to this forum thread.

    Thank you in advance for your cooperation.

    Regards,
    Dimitar
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  13. paulo g
    paulo g avatar
    5 posts
    Member since:
    Oct 2012

    Posted 12 Aug in reply to Dimitar Link to this post

    Hi

    About "this.radGridView1.TableElement.ScrollToRow(radGridView1.ChildRows.Count);"

    Has  radpivotgrid  got some similar functionallity?

     

    Regards

    Paulo

  14. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3900 posts

    Posted 13 Aug Link to this post

    Hello, Paulo,

    The ScrollToRow method is relevant only for RadGridView. RadPivotGrid doesn't have such an equivalent.

    The possibility that RadPivotGrid offers is to manage directly the value of the respective scrollbar in RadPivotGrid. Feel free to increase/decrease the Value property of the PivotGridElement.VScrollBar and PivotGridElement.HScrollBar.
     
    I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

     

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik

Back to Top