Data Binding

ComponentOne DataGrid for Silverlight's C1DataGrid control can be bound to any object that implements the System.Collections.IEnumerable interface (such as XmlDataProviderObjectDataProvider, DataSet, DataView, and so on). You can use the C1DataGrid.ItemsSource property to bind the C1DataGrid.

To bind the grid, simply set the ItemsSource property to an IEnumerable implementation. Each row in the data grid will be bound to an object in the data source, and each column in the data grid will be bound to a property of the data object.

Note that in order for the C1DataGrid user interface to update automatically when items are added to or removed from the source data, the control must be bound to a collection that implements INotifyCollectionChanged, such as an ObservableCollection<(Of <(T>)>).

See WCF RIA Services Data Binding and Binding the Grid to a WCF RIA Services Data Source for information about binding the grid to an RIA Services data source. See Binding the Grid to an RSS Feed and Binding the Grid to a Web Service for data binding examples. For steps on binding a C1DataGrid control to an XML data source, see the DataGrid for Silverlight Quick Start.


Send us comments about this topic.
Copyright © GrapeCity, inc. All rights reserved.