Data binding allows you to establish a link between the UI and the underlying business logic and to keep them synchronized. It means that when a value is changed in the business layer, that change is automatically populated to the UI and vice versa. Of course, in order for this to work, you have to implement the proper notification or to use objects that have already implemented it.

Binding to RadRating involves the following property:

RadRating.ItemsSource - gets or sets the data source (IEnumerable) used to generate the content of the rating control. It can be bound to data from a variety of data sources in the form of common language runtime (CLR) objects.

To bind the RadRating to a collection of business objects, you should use its ItemsSource property. If you want the changes to the collection to be automatically reflected to the RadRatingItems, the collection should implement the INotifyCollectionChanged interface. There is a build-in collection in Silverlight, which implements the INotifyCollectionChanged interface and you could use it without making any effort - this is the generic ObservableCollection. However, to get full benefit from the change notification support, your custom business objects should implement the INotifyPropertyChanged interface.

Consider using ObservableCollection or one of the other existing collection classes like List, Collection, instead of implementing your own collection. If the scenario requires a custom collection to be implemented, use the IList interface, which provides individual access by index to its items and the best performance.

Was this article helpful?

/

Give article feedback

Tell us how we can improve this article

Code samples are inaccurate / outdated.
I expected to find other / more information.
There are typos / broken links / broken page elements.
Content is inaccurate / outdated.
Other
By checking this box you consent to Progress contacting you by email about your response on this page.

Community

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.