Listbox not rendering when i use BringToView

4 posts, 0 answers
  1. Doug
    Doug avatar
    49 posts
    Member since:
    May 2012

    Posted 20 Dec 2012 Link to this post

    Hi

    I have a page with a listbox working as a chat box.
    When I open the page and i get my data asynchronously I would like to BringToView on the end of this list. But when I touch it, and scroll manually it appears. I have to note that it is not happening every time.

    I figured out that if I add a delay for for example 300 miliseconds before bringing to view fixes this... only that in this case it i weird as the list jumps by itself... and I wouldn't really use this solution

    I have attached a sample application demonstrating this:
    http://www.mapcat.net/public/344838_ID524488.zip

    Best Regards Doug
  2. Deyan
    Admin
    Deyan avatar
    2037 posts

    Posted 20 Dec 2012 Link to this post

    Hello Doug,

    I cannot find the attachment here. Can you please make sure that you're correctly attaching your sample.

    If you try to upload a project here, you will need to open a new support ticket.

    Regards,
    Deyan
    the Telerik team
    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. Doug
    Doug avatar
    49 posts
    Member since:
    May 2012

    Posted 20 Dec 2012 Link to this post

    Yes I couldn't attach it there so I was uploading it... I wasn't expecting such a fast reply.... I've edited my post, added a link for download.
  5. Todor
    Admin
    Todor avatar
    778 posts

    Posted 27 Dec 2012 Link to this post

    Hi Doug,

    Try calling the BringIntoView after the control is loaded:
    public MainPage()
    {
        InitializeComponent();
        this.DataContext = this.mainViewModel;
        Loaded += MainPage_Loaded;
    }
     
    void MainPage_Loaded(object sender, RoutedEventArgs e)
    {
        this.dataBoundListBox1.BringIntoView(this.mainViewModel.DataItems[this.mainViewModel.DataItems.Count - 1]);
    }

    Let me know if you still experience issues.

    Regards,
    Todor
    the Telerik team
    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