# C1.Win.FlexGrid.C1FlexGridBase.DataSource

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Win_FlexGrid_C1FlexGridBase_DataSource_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.DataSource*">DataSource Property
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Win_FlexGrid_C1FlexGridBase_DataSource_" data-uid="C1.Win.FlexGrid.C1FlexGridBase.DataSource*"></a>
<h4 id="C1_Win_FlexGrid_C1FlexGridBase_DataSource" data-uid="C1.Win.FlexGrid.C1FlexGridBase.DataSource">DataSource</h4>
<div class="markdown level1 summary"><p>Gets or sets the data source for the grid.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public object DataSource { get; set; }</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Property DataSource As Object</code></pre>
</div>
<h5 id="C1_Win_FlexGrid_C1FlexGridBase_DataSource_remarks">Remarks</h5>
<div class="markdown level1 remarks"><p>Any object that implements the <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.collections.ilist">IList</a> or <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.componentmodel.ilistsource">IListSource</a> 
interfaces can be used as a data source.</p>
<p>Specifically, the following ADO.NET data sources are valid: DataTable, DataView,
DataSet, and DataViewManager.</p>
<p>The following ComponentOne DataObjects components are also valid data sources:
C1ExpressTable, C1ExpressVew, C1ExpressConnection, C1DataView, C1DataTableSource, and C1DataSet.</p>
<p>If the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DataSource.html#C1_Win_FlexGrid_C1FlexGridBase_DataSource">DataSource</a> reference contains more than one table, you must 
also set the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DataMember.html#C1_Win_FlexGrid_C1FlexGridBase_DataMember">DataMember</a> 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.</p>
<p>You can use the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.SetDataBinding.html#C1_Win_FlexGrid_C1FlexGridBase_SetDataBinding_System_Object_System_String_">SetDataBinding(object, string)</a> method to set the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DataSource.html#C1_Win_FlexGrid_C1FlexGridBase_DataSource">DataSource</a> 
and <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DataMember.html#C1_Win_FlexGrid_C1FlexGridBase_DataMember">DataMember</a> properties simultaneously.</p>
<p>You can also assign another <a class="xref" href="C1.Win.FlexGrid.C1FlexGrid.html">C1FlexGrid</a> object to the <a class="xref" href="C1.Win.FlexGrid.C1FlexGridBase.DataSource.html#C1_Win_FlexGrid_C1FlexGridBase_DataSource">DataSource</a> 
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.</p>
</div>
</div>
