Automatically Scroll to the last Item in ListBox

2 posts, 0 answers
  1. ITA
    ITA avatar
    384 posts
    Member since:
    Aug 2009

    Posted 10 Sep 2014 Link to this post


    i have a little application running as trayicon. Here i use a RadListBox to add some informations for the user.

    In my code behind:
    var item1 = new RadListBoxItem() { Content = "Start Sync" +  Convert.ToString(i)};

    works fine. But how do i scroll down to the latest added item in my ListBox?

    Thanks a lot, best Regards
  2. Kalin
    Kalin avatar
    1283 posts

    Posted 10 Sep 2014 Link to this post

    Hi Rene,

    In order to scroll the ListBox you can use the ScrollIntoView method of the control. You would need to just pass the index of the desired item (last index in your case) as shown below:

    this.listBox.ScrollIntoView(this.listBox.Items.Count - 1);

    Hope this helps.

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