Change content on existing item

Thread is closed for posting
2 posts, 0 answers
  1. Artem
    Artem avatar
    1 posts
    Member since:
    May 2014

    Posted 14 May 2014 Link to this post

    I have DataBoundListBox template with some image and text.
    When I select item, I navigating to another page.
    When I navigating back, I want to change image on selected item.

    I see two ways:
    - navigate back => reload itemssource (there are checking of which image must be bind on item) => focus on edited item.
    - navigate back => change image on item (without itemssource reloading) and focus on it.

    But I have a question for the first solution: how can I focus on edited item? Default ListBox returns to the previous state after reloading, but DataBoundListBos doesn't do it.

    And for the second solution: how can I change image source (or other content) on existing item withoud ItemsSource reloading?

    Sorry for my poor english.
  2. Deyan
    Deyan avatar
    2147 posts

    Posted 19 May 2014 Link to this post

    Hello Artem,

    To update the contents of a DataBoundListBox' item you simply need to properly fire the PropertyChanged event from the INotifyPropertyChanged interface on your business objects. This is the natural way to update UI elements in Silverlight and we do not work in a different manner.

    You don't need to reload the whole items source in order to update a single item. Just make sure the INotifyPropertyChanged interface is correctly implemented by your ViewModel class.

    That's all you need to do.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top