DataGridTableStyle Constructores

Definición

Inicializa una nueva instancia de la clase DataGridTableStyle.Initializes a new instance of the DataGridTableStyle class.

Sobrecargas

DataGridTableStyle()

Inicializa una nueva instancia de la clase DataGridTableStyle.Initializes a new instance of the DataGridTableStyle class.

DataGridTableStyle(Boolean)

Inicializa una nueva instancia de la clase DataGridTableStyle usando el valor especificado para determinar si la tabla de la cuadrícula es el estilo predeterminado.Initializes a new instance of the DataGridTableStyle class using the specified value to determine whether the grid table is the default style.

DataGridTableStyle(CurrencyManager)

Inicializa una nueva instancia de la clase DataGridTableStyle con el objeto CurrencyManagerespecificado.Initializes a new instance of the DataGridTableStyle class with the specified CurrencyManager.

DataGridTableStyle()

Inicializa una nueva instancia de la clase DataGridTableStyle.Initializes a new instance of the DataGridTableStyle class.

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

Ejemplos

En el ejemplo de código siguiente se crea un nuevo DataGridTableStyle y se agrega a la GridTableStylesCollection.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)

Inicializa una nueva instancia de la clase DataGridTableStyle usando el valor especificado para determinar si la tabla de la cuadrícula es el estilo predeterminado.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)

Parámetros

isDefaultTableStyle
Boolean

Es true para especificar la tabla como valor predeterminado; en caso contrario, es false.true to specify the table as the default; otherwise, false.

Ejemplos

En el ejemplo de código siguiente se crea un nuevo DataGridTableStyle y se agrega a la GridTableStylesCollection.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)

Inicializa una nueva instancia de la clase DataGridTableStyle con el objeto CurrencyManagerespecificado.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)

Parámetros

listManager
CurrencyManager

CurrencyManager que se va a usar.The CurrencyManager to use.

Ejemplos

En el ejemplo de código siguiente se crea un nuevo DataGridTableStyle con un CurrencyManager para un DataTable.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

Se aplica a