Binding Grid for WPF to a Data Source
ComponentOne Grid for WPF's C1DataGrid control can be bound to any object that implements the System.Collections.IEnumerable interface (such as XmlDataProvider, ObjectDataProvider, DataSet, DataView, and so on). Objects that implement the System.ComponentModel.IListSource interface are supported as well, for example the System.Data.DataTable class instances. You can use the ItemsSource property to bind the C1DataGrid.
For example, the following XAML binds the grid to the Products table in the ProductsDataSet; the latter is accessible via the ProductsDataSet property of the root Window containing the grid:
<c1grid:C1DataGrid Name="C1DataGrid1" ItemsSource="{Binding Path=ProductsDataSet.Products, ElementName=Window, Mode=Default}"/>
The ItemsSource property can be set to any object that implements the System.Collections.IEnumerable or System.ComponentModel.IListSource interfaces.
For steps on binding a C1DataGrid control to an access database using Visual Studio 2008 and Expression Blend, see Binding Grid for WPF to a Database.
|