Gets or sets the data source that the System.Windows.Forms.DataGridView is displaying data for.
Documentation for this section has not yet been entered.
The System.Windows.Forms.DataGridView class supports the standard Windows Forms data-binding model. This means the data source can be of any type that implements one of the following interfaces:
The IList interface, including one-dimensional arrays.
For specific examples, see the Example section and the task table at the end of this section.
Typically, you will bind to a System.Windows.Forms.BindingSource component and bind the System.Windows.Forms.BindingSource component to another data source or populate it with business objects. The System.Windows.Forms.BindingSource component is the preferred data source because it can bind to a wide variety of data sources and can resolve many data binding issues automatically.
When binding to a data source that contains multiple lists or tables, you must set the DataGridView.DataMember property to a string that specifies the list or table to bind to. When binding to a System.Windows.Forms.BindingSource component that contains multiple lists or tables, however, you can set the BindingSource.DataMember property of the System.Windows.Forms.BindingSource component instead.
When binding to an object collection rather than to database data, you will typically set the DataGridViewCellStyle.DataSourceNullValue property of the object returned by the DataGridView.DefaultCellStyle property to null rather than using the default value of DBNull.Value, which is appropriate for database data.
For more information, see Displaying Data in the Windows Forms DataGridView Control. The following table provides direct links to common tasks related to the DataGridView.DataSource property.