Initializes a new instance of the TableBindingAdapter class using the specified RowCollection.

Namespace:  ESRI.ArcGISExplorer.Data

Assembly:  ESRI.ArcGISExplorer (in ESRI.ArcGISExplorer.dll) Version: 2.0.0.1500 (2.0.0.1500)

Syntax

C#
public TableBindingAdapter(
	RowCollection wrappedRows
)
Visual Basic (Declaration)
Public Sub New ( _
	wrappedRows As RowCollection _
)

Parameters

wrappedRows
Type: ESRI.ArcGISExplorer.Data..::.RowCollection

A RowCollection object which contains Row objects each of which represents a record in the Table.

Remarks

After creating a TableBindingAdapter for a particular RowCollection, use the Fill method to read the rows from the RowCollection into the TableBindingAdapter.

Examples

The code below creates a TableBindingAdapter object for a file geodatabase feature class and fills it with the rows from a RowCollection. An example is also provided to show how to then bind the adapter to a .NET DataGridView control.
CopyC#
{
  //Open the mountains fill geodatabase feature class
  Table mountainsTable = Table.OpenFileGeodatabaseTable(@"C:\Data\Scotland.gdb", "mountains");

  //Return only the mountain rows where the type is Munro.
  RowCollection munroRows = mountainsTable.Search(new Filter("Type='Munro'"));

  //Create a new TableBindingAdapter object for only the rows in the mountains table
  //which are classified as being Munros.
  TableBindingAdapter tableAdapter = new TableBindingAdapter(munroRows);

  //Set the UseCodedValueDomains property to display the descriptive name for the values in any
  //columns which have a CodedValueDomainDefined
  tableAdapter.UseCodedValueDomains = true;

  //Set the UseColumnAliasNames property to display alias names in the Column headers.
  tableAdapter.UseColumnAliasNames = true;

  //Fill the adapter with the specified rows
  tableAdapter.Fill();

  //Note that the BindingSource component and the DataGridView control would normally be
  //instantiated by dragging and dropping them onto a Windows Form from the toolbox.

  //Create a new BindingSource component
  System.Windows.Forms.BindingSource bindingSource1 = new System.Windows.Forms.BindingSource();
  //Set the DataSource to be the tableAdapter object
  bindingSource1.DataSource = tableAdapter;

  //Create a DataGridView control
  System.Windows.Forms.DataGridView dataGridView1 = new System.Windows.Forms.DataGridView();
  //Set the Datasource to be the bindingSource1 object 
  dataGridView1.DataSource = bindingSource1;
}
CopyVB.NET
'Open the mountains file geodatabase feature class
Dim mountainsTable As Table = Table.OpenFileGeodatabaseTable("C:\Data\Scotland.gdb", "mountains")

'Return only the mountain rows where the type is Munro.
Dim munroRows As RowCollection = mountainsTable.Search(New Filter("Type='Munro'"))

'Create a new TableBindingAdapter object for only the rows in the mountains table
'which are classified as being Munros.
Dim tableAdapter As TableBindingAdapter = New TableBindingAdapter(munroRows)

'Set the UseCodedValueDomains property to display the descriptive name for the values in any
'columns which have a CodedValueDomainDefined
tableAdapter.UseCodedValueDomains = True

'Set the UseColumnAliasNames property to display alias names in the Column headers.
tableAdapter.UseColumnAliasNames = True

'Fill the adapter with all the rows from the mountains Table
tableAdapter.Fill()

'note that the BindingSource component and the DataGridView control would normally be
'instantiated by dragging and dropping them onto a Windows Form from the toolbox.


'Create a new BindingSource component
Dim bindingSource1 As System.Windows.Forms.BindingSource = New System.Windows.Forms.BindingSource()
'Set the DataSource to be the tableAdapter object
bindingSource1.DataSource = tableAdapter

'Create a DataGridView control
Dim dataGridView1 As System.Windows.Forms.DataGridView = New System.Windows.Forms.DataGridView()
'Set the Datasource to be the bindingSource1 object 
dataGridView1.DataSource = bindingSource1

See Also