ListObject::SetDataBinding Method (Object^, String^)
Binds a ListObject control to a specified data member of a data source.
Assembly: Microsoft.Office.Tools.Excel (in Microsoft.Office.Tools.Excel.dll)
Parameters
- dataSource
-
Type:
System::Object^
The object to use as a data source for the ListObject control.
- dataMember
-
Type:
System::String^
The DataMember that specifies the property to bind to within the object returned by the DataSource.
| Exception | Condition |
|---|---|
| SetDataBindingFailedException | Could not bind to the specified data source. |
| ArgumentException | One or more of the arguments are invalid. |
| ArgumentNullException | The dataSource argument is null. |
The data source can be any object that implements IList, IListSource, IBindingList, or IEnumerable.
The data member must be a property of the data source that returns a bindable collection. For example, a DataSet source has tables as data members.
Show: