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

Change content on existing item

1 Answer 27 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.
Artem
Top achievements
Rank 1
Artem asked on 14 May 2014, 09:04 AM
Hi,
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.
Thanks

1 Answer, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 19 May 2014, 07:41 AM
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.

Regards,
Deyan
Telerik
 

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.

 
Tags
DataBoundListBox
Asked by
Artem
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Share this question
or