GridTableStylesCollection.AddRange(DataGridTableStyle[]) Yöntem
Tanım
Önemli
Bazı bilgiler ürünün ön sürümüyle ilgilidir ve sürüm öncesinde önemli değişiklikler yapılmış olabilir. Burada verilen bilgilerle ilgili olarak Microsoft açık veya zımni hiçbir garanti vermez.
Koleksiyona tablo stilleri dizisi ekler.
public:
virtual void AddRange(cli::array <System::Windows::Forms::DataGridTableStyle ^> ^ tables);
public virtual void AddRange (System.Windows.Forms.DataGridTableStyle[] tables);
abstract member AddRange : System.Windows.Forms.DataGridTableStyle[] -> unit
override this.AddRange : System.Windows.Forms.DataGridTableStyle[] -> unit
Public Overridable Sub AddRange (tables As DataGridTableStyle())
Parametreler
- tables
- DataGridTableStyle[]
Bir nesne dizisi DataGridTableStyle .
Örnekler
Aşağıdaki kod örneğinde bu üyenin kullanımı gösterilmektedir.
void AddArray()
{
/* Get three CurrencyManager objects used to construct
DataGridTableSTyle objects. */
CurrencyManager^ customersManager =
dynamic_cast<CurrencyManager^>(this->BindingContext[myDataSet, "Customers"]);
CurrencyManager^ regionsManager =
dynamic_cast<CurrencyManager^>(this->BindingContext[myDataSet, "Customers"]);
CurrencyManager^ productsManager =
dynamic_cast<CurrencyManager^>(this->BindingContext[myDataSet, "Customers"]);
DataGridTableStyle^ gridCustomers = gcnew DataGridTableStyle( customersManager );
DataGridTableStyle^ gridRegions = gcnew DataGridTableStyle( regionsManager );
DataGridTableStyle^ gridProducts = gcnew DataGridTableStyle( productsManager );
// Create a DataGridTableStyle array.
array<DataGridTableStyle^>^myGrids = {gridCustomers,gridRegions,gridProducts};
// Use AddRange to add to the collection.
myDataGrid->TableStyles->AddRange( myGrids );
}
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);
}
private Sub AddArray()
' Get three CurrencyManager objects used to construct
' DataGridTableSTyle objects.
Dim customersManager As CurrencyManager = _
CType(me.BindingContext(myDataSet, "Customers"), CurrencyManager)
Dim regionsManager As CurrencyManager = _
CType(me.BindingContext(myDataSet, "Customers"), CurrencyManager)
Dim productsManager As CurrencyManager = _
CType(me.BindingContext(myDataSet, "Customers"), CurrencyManager)
Dim gridCustomers As DataGridTableStyle = _
new DataGridTableStyle(customersManager)
Dim gridRegions As DataGridTableStyle = _
new DataGridTableStyle(regionsManager)
Dim gridProducts As DataGridTableStyle = _
new DataGridTableStyle(productsManager)
' Create a DataGridTableStyle array.
Dim myGrids() As DataGridTableStyle = {gridCustomers, gridRegions, gridProducts}
' Use AddRange to add to the collection.
myDataGrid.TableStyles.AddRange(myGrids)
End Sub
Şunlara uygulanır
GitHub'da bizimle işbirliği yapın
Bu içeriğin kaynağı GitHub'da bulunabilir; burada ayrıca sorunları ve çekme isteklerini oluşturup gözden geçirebilirsiniz. Daha fazla bilgi için katkıda bulunan kılavuzumuzu inceleyin.