C1.Win.C1FlexGrid Namespace > C1FlexGridBase Class : DataSource Property |
'Declaration
<C1DescriptionAttribute("Gets or sets the data source for the grid.")> <C1CategoryAttribute("Data")> <DefaultValueAttribute()> <RefreshPropertiesAttribute(RefreshProperties.Repaint)> <AttributeProviderAttribute(TypeName="System.ComponentModel.IListSource, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", PropertyName="")> Public Property DataSource As Object
'Usage
Dim instance As C1FlexGridBase Dim value As Object instance.DataSource = value value = instance.DataSource
[C1Description("Gets or sets the data source for the grid.")] [C1Category("Data")] [DefaultValue()] [RefreshProperties(RefreshProperties.Repaint)] [AttributeProvider(TypeName="System.ComponentModel.IListSource, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", PropertyName="")] public object DataSource {get; set;}
[C1Description("Gets or sets the data source for the grid.")] [C1Category("Data")] [DefaultValue()] [RefreshProperties(RefreshProperties.Repaint)] [AttributeProvider(TypeName="System.ComponentModel.IListSource, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089", PropertyName="")] public: property Object^ DataSource { Object^ get(); void set ( Object^ value); }
Any object that implements the System.Collections.IList or System.ComponentModel.IListSource interfaces can be used as a data source.
Specifically, the following ADO.NET data sources are valid: DataTable, DataView, DataSet, and DataViewManager.
The following ComponentOne DataObjects components are also valid data sources: C1ExpressTable, C1ExpressVew, C1ExpressConnection, C1DataView, C1DataTableSource, and C1DataSet.
If the DataSource reference contains more than one table, you must also set the DataMember property a string that specifies the table to bind to. For example, if the DataSource is a DataSet or DataViewManager that contains three tables named Customers, Orders, and OrderDetails, you must specify one of the tables to bind to.
You can use the SetDataBinding(Object,String) method to set the DataSource and DataMember properties simultaneously.
You can also assign another C1FlexGrid object to the DataSource property. In this case, the controls will share the same grid model, including the data, display styles, selection, etc. This can be used to implement split views, where different controls display different parts of the same data.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2