This is a migrated thread and some comments may be shown as answers.

RadListView scroll

1 Answer 448 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Shachaf
Top achievements
Rank 1
Shachaf asked on 11 Mar 2013, 11:49 AM
Hello,

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

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 13 Mar 2013, 02:16 PM
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,
Stefan
the Telerik team
WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Tags
ListView
Asked by
Shachaf
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or