GridTableStylesCollection.AddRange Method (DataGridTableStyle[])

 

Adds an array of table styles to the collection.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public virtual void AddRange(
	DataGridTableStyle[] tables
)

Parameters

tables
Type: System.Windows.Forms.DataGridTableStyle[]

An array of DataGridTableStyle objects.

The following code example demonstrates the use of this member.

private void AddArray()
{


/* Get three CurrencyManager objects used to construct 
DataGridTableSTyle objects. */
CurrencyManager customersManager = (CurrencyManager)
this.BindingContext[myDataSet, "Customers"];

CurrencyManager regionsManager = (CurrencyManager)
this.BindingContext[myDataSet, "Customers"];

CurrencyManager productsManager = (CurrencyManager)
this.BindingContext[myDataSet, "Customers"];


DataGridTableStyle gridCustomers = 
new DataGridTableStyle(customersManager);
DataGridTableStyle gridRegions = 
new DataGridTableStyle(regionsManager);
DataGridTableStyle gridProducts = 
new DataGridTableStyle(productsManager);

// Create a DataGridTableStyle array.
DataGridTableStyle[] myGrids = {gridCustomers, gridRegions, gridProducts};

// Use AddRange to add to the collection.
myDataGrid.TableStyles.AddRange(myGrids);

}

.NET Framework
Available since 1.1
Return to top
Show: