RadListView scroll

2 posts, 0 answers
  1. Shachaf
    Shachaf avatar
    3 posts
    Member since:
    Oct 2012

    Posted 11 Mar 2013 Link to this post


    I'm having problems when updating the DataSource property.
    when I update the DataSource property of a radListView object the scroll bar jumps to the start.
    when accessing the scroll properties (.AutoScrollPosition, VerticalScroll.Value) i always get that the value is 0.
    how can i keep the ListView in it's place (making the scroll not go back to the start of the list)?

    thank you

  2. Stefan
    Stefan avatar
    2911 posts

    Posted 13 Mar 2013 Link to this post

    Hi Shachaf,

    Thank you for writing.

    What you can do is to save the scroll bar value and then restore it after reassigning your data source:
    void radButton1_Click(object sender, EventArgs e)
        int saveScroll = radListView1.ListViewElement.ViewElement.VScrollBar.Value;
        //change data source
        radListView1.ListViewElement.ViewElement.VScrollBar.Value = saveScroll;

    I hope that you find this information useful.

    Kind regards,
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top