FlexGrid for WinForms | ComponentOne
C1.Win.C1FlexGrid.Classic Namespace / C1FlexGridClassic Class / DataSource Property

In This Topic
    DataSource Property (C1FlexGridClassic)
    In This Topic
    Gets or sets the data source for the grid.
    Syntax
    'Declaration
     
    
    Public Property DataSource As Object
    public object DataSource {get; set;}
    Remarks

    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 C1.Win.C1FlexGrid.C1FlexGridBase.DataSource reference contains more than one table, you must also set the C1.Win.C1FlexGrid.C1FlexGridBase.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 C1.Win.C1FlexGrid.C1FlexGridBase.DataSource and C1.Win.C1FlexGrid.C1FlexGridBase.DataMember properties simultaneously.

    You can also assign another C1.Win.C1FlexGrid.C1FlexGrid object to the C1.Win.C1FlexGrid.C1FlexGridBase.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.

    See Also