DataGridTableStyle Konstruktoren

Definition

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse.Initializes a new instance of the DataGridTableStyle class.

Überlädt

DataGridTableStyle()

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse.Initializes a new instance of the DataGridTableStyle class.

DataGridTableStyle(Boolean)

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse. Dabei wird mit dem angegebenen Wert bestimmt, ob die Tabelle im Standardformat vorliegt.Initializes a new instance of the DataGridTableStyle class using the specified value to determine whether the grid table is the default style.

DataGridTableStyle(CurrencyManager)

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse mit der angegebenen CurrencyManager.Initializes a new instance of the DataGridTableStyle class with the specified CurrencyManager.

DataGridTableStyle()

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse.Initializes a new instance of the DataGridTableStyle class.

public:
 DataGridTableStyle();
public DataGridTableStyle ();
Public Sub New ()

Beispiele

Im folgenden Codebeispiel wird ein neues DataGridTableStyle erstellt und dem GridTableStylesCollection hinzugefügt.The following code example creates a new DataGridTableStyle and adds it to the GridTableStylesCollection.

private:
   void AddGridTable()
   {
      DataGridTableStyle^ myGridTableStyle;
      myGridTableStyle = gcnew DataGridTableStyle;
      myGridTableStyle->MappingName = "Customers";
      dataGrid1->TableStyles->Add( myGridTableStyle );
   }
private void AddGridTable(){
   DataGridTableStyle myGridTableStyle;
   myGridTableStyle = new DataGridTableStyle();
   myGridTableStyle.MappingName = "Customers";
   dataGrid1.TableStyles.Add(myGridTableStyle);
}

Private Sub AddGridTable()
   Dim myGridTableStyle As DataGridTableStyle
   myGridTableStyle = New DataGridTableStyle()
   myGridTableStyle.MappingName = "Customers"
   dataGrid1.TableStyles.Add(myGridTableStyle)
End Sub 

DataGridTableStyle(Boolean)

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse. Dabei wird mit dem angegebenen Wert bestimmt, ob die Tabelle im Standardformat vorliegt.Initializes a new instance of the DataGridTableStyle class using the specified value to determine whether the grid table is the default style.

public:
 DataGridTableStyle(bool isDefaultTableStyle);
public DataGridTableStyle (bool isDefaultTableStyle);
new System.Windows.Forms.DataGridTableStyle : bool -> System.Windows.Forms.DataGridTableStyle
Public Sub New (isDefaultTableStyle As Boolean)

Parameter

isDefaultTableStyle
Boolean

true, um als Tabellenformat den Standard anzugeben, andernfalls false.true to specify the table as the default; otherwise, false.

Beispiele

Im folgenden Codebeispiel wird ein neues DataGridTableStyle erstellt und dem GridTableStylesCollection hinzugefügt.The following code example creates a new DataGridTableStyle and adds it to the GridTableStylesCollection.

private:
   void AddGridTable()
   {
      DataGridTableStyle^ myGridTableStyle;
      myGridTableStyle = gcnew DataGridTableStyle;
      myGridTableStyle->MappingName = "Customers";
      dataGrid1->TableStyles->Add( myGridTableStyle );
   }
private void AddGridTable(){
   DataGridTableStyle myGridTableStyle;
   myGridTableStyle = new DataGridTableStyle();
   myGridTableStyle.MappingName = "Customers";
   dataGrid1.TableStyles.Add(myGridTableStyle);
}

Private Sub AddGridTable()
   Dim myGridTableStyle As DataGridTableStyle
   myGridTableStyle = New DataGridTableStyle()
   myGridTableStyle.MappingName = "Customers"
   dataGrid1.TableStyles.Add(myGridTableStyle)
End Sub 

DataGridTableStyle(CurrencyManager)

Initialisiert eine neue Instanz der DataGridTableStyle-Klasse mit der angegebenen CurrencyManager.Initializes a new instance of the DataGridTableStyle class with the specified CurrencyManager.

public:
 DataGridTableStyle(System::Windows::Forms::CurrencyManager ^ listManager);
public DataGridTableStyle (System.Windows.Forms.CurrencyManager listManager);
new System.Windows.Forms.DataGridTableStyle : System.Windows.Forms.CurrencyManager -> System.Windows.Forms.DataGridTableStyle
Public Sub New (listManager As CurrencyManager)

Parameter

listManager
CurrencyManager

Der zu verwendende CurrencyManager.The CurrencyManager to use.

Beispiele

Im folgenden Codebeispiel wird ein neues DataGridTableStyle mit einem CurrencyManager für einen DataTable erstellt.The following code example creates a new DataGridTableStyle using a CurrencyManager for a DataTable.

private:
   void CreateDataGridGridTableStyle()
   {
      CurrencyManager^ myCurrencyManager;
      DataGridTableStyle^ myGridTableStyle;
      
      /* Get the CurrencyManager for a DataTable named "Customers"
         found in a DataSet named "myDataSet". */
      myCurrencyManager = dynamic_cast<CurrencyManager^>(BindingContext[myDataSet, "Customers"]);
      myGridTableStyle = gcnew DataGridTableStyle( myCurrencyManager );
      
      // Add the table style to the collection of a DataGrid.
      myDataGrid->TableStyles->Add( myGridTableStyle );
   }

private void CreateDataGridGridTableStyle(){
   CurrencyManager myCurrencyManager;
   DataGridTableStyle myGridTableStyle;
   /* Get the CurrencyManager for a DataTable named "Customers"
   found in a DataSet named "myDataSet". */
   myCurrencyManager = 
   (CurrencyManager) BindingContext[myDataSet, "Customers"];
   myGridTableStyle = new DataGridTableStyle(myCurrencyManager);
   // Add the table style to the collection of a DataGrid.
   myDataGrid.TableStyles.Add(myGridTableStyle);
}
 
Private Sub CreateDataGridGridTableStyle()
   Dim myCurrencyManager As CurrencyManager
   Dim myGridTableStyle As DataGridTableStyle
   ' Get the CurrencyManager for a DataTable named "Customers"
   ' found in a DataSet named "myDataSet". 
   myCurrencyManager = CType _
   (Me.BindingContext(myDataSet, "Customers"), CurrencyManager)
   myGridTableStyle = New DataGridTableStyle(myCurrencyManager)
   ' Add the table style to the collection of a DataGrid.
   myDataGrid.TableStyles.Add(myGridTableStyle)
End Sub

Gilt für: