stop auto scrolling when adding items to RadDataBoundListBox

4 posts, 0 answers
  1. Kimitake
    Kimitake avatar
    2 posts
    Member since:
    Jun 2011

    Posted 07 Nov 2013 Link to this post

    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,
  2. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 07 Nov 2013 Link to this post

    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.
  3. DevCraft banner
  4. Kimitake
    Kimitake avatar
    2 posts
    Member since:
    Jun 2011

    Posted 07 Nov 2013 Link to this post

    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.
  5. Deyan
    Admin
    Deyan avatar
    2041 posts

    Posted 08 Nov 2013 Link to this post

    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.
Back to Top
DevCraft banner