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

stop auto scrolling when adding items to RadDataBoundListBox

3 Answers 68 Views
DataBoundListBox
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Kimitake
Top achievements
Rank 1
Kimitake asked on 07 Nov 2013, 07:26 AM
Hi,

I'm using RadDataBoundListBox to display ObservableCollection list.
When I adding new items to this ObservableCollection list, sometimes I need to add top of the list,
currently I'm calling insert method.

The problem is ListBox shows the list from top. I want to keep the ListBox position.
How can I do this?


If I add items calling add method, this ListBox does not scroll as expected.

To avoid this behavior, I just keep the top Item of view port and try to call BringIntoView,
but sometimes it works and sometimes the ListBox goes to wrong position.

Regards,

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 07 Nov 2013, 09:34 AM
Hello Kimitake,

Thanks for writing.

You can adjust this behavior by setting the properties of the StackVirtualizationStrategyDefinition object that is used to defines the way DataBoundListBox will layout its items.

Take a look at this article here:

Using Stack Virtualization Strategy in RadDataBoundListBox

Pay attention to the Using the ReorderMode property.

You will basically need to set the VirtualizationStrategyDefinition property of RadDataBoundLIstBOx to a new instance of StackVirtualizationStrategyDefinition and set the ReorderMode of the StackVirtualizationStrategyDefinition instance to MoveItemsUp.

I hope this helps.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
0
Kimitake
Top achievements
Rank 1
answered on 08 Nov 2013, 04:03 AM
thanks, it works on my test app.
In my app case, the list sometimes goes to wrong position, but I guess my code is something wrong.
0
Deyan
Telerik team
answered on 08 Nov 2013, 02:04 PM
Hi Kimitake,

We will consider the case closed for now.

Let us know if we can be of further help.

Regards,
Deyan
Telerik
Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Tags
DataBoundListBox
Asked by
Kimitake
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Kimitake
Top achievements
Rank 1
Share this question
or