Comparteix a través de


DataGridColumnStyle.ResetHeaderText Método

Definición

Restablece HeaderText a su valor predeterminado, null.

public:
 void ResetHeaderText();
public void ResetHeaderText ();
member this.ResetHeaderText : unit -> unit
Public Sub ResetHeaderText ()

Ejemplos

En el ejemplo de código siguiente se muestra el uso de este miembro.

private:
   void SetHeaderText( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Set the HeaderText property.
      myDataGridColumnStyle->HeaderText = "Emp ID";
      myDataGrid->Invalidate();
   }

   void ResetHeaderText( Object^ /*sender*/, System::EventArgs^ /*e*/ )
   {
      // Reset the HeaderText property to its default value.
      myDataGridColumnStyle->ResetHeaderText();
      myDataGrid->Invalidate();
   }
private void SetHeaderText(object sender, System.EventArgs e)
{
   // Set the HeaderText property.
   myDataGridColumnStyle.HeaderText = "Emp ID";
   myDataGrid.Invalidate();
} 
private void ResetHeaderText(object sender, System.EventArgs e)
{
   // Reset the HeaderText property to its default value.
   myDataGridColumnStyle.ResetHeaderText();
   myDataGrid.Invalidate();
   }
Private Sub SetHeaderText(ByVal sender As Object, ByVal e As EventArgs)
   ' Set the HeaderText property.
   myDataGridColumnStyle.HeaderText = "Emp ID"
   myDataGrid.Invalidate()
End Sub

Private Sub ResetHeaderText(ByVal sender As Object, ByVal e As EventArgs)
   ' Reset the HeaderText property to its default value.
   myDataGridColumnStyle.ResetHeaderText()
   myDataGrid.Invalidate()
End Sub

Comentarios

Normalmente, se usa este método si va a crear un diseñador para System.Windows.Forms.DataGrido crear su propio control que incorpore .System.Windows.Forms.DataGrid

Se aplica a