DataGridTableStyle.RowHeadersVisible Property


Gets or sets a value indicating whether row headers are visible.

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

public bool RowHeadersVisible { get; set; }

Property Value

Type: System.Boolean

true if row headers are visible; otherwise, false. The default is true.

When row headers are visible, a plus sign is displayed in each row header if the underlying DataTable has a related child table.

This property will not function until you add DataGridTableStyle objects to the GridTableStylesCollection. Until then, setting this property will have no effect.

The following code example demonstrates the use of this member.

// Instantiate the EventHandler.
public void AttachRowHeaderVisibleChanged()
   myDataGridTableStyle.RowHeadersVisibleChanged += new EventHandler (MyDelegateRowHeadersVisibleChanged);

// raise the event when RowHeadersVisible property is changed.
private void MyDelegateRowHeadersVisibleChanged(object sender, EventArgs e)
   string myString = "'RowHeadersVisibleChanged' event raised, Row Headers are";
   if (myDataGridTableStyle.RowHeadersVisible)
      myString += " visible";
      myString += " not visible";

   MessageBox.Show(myString, "RowHeader information");

// raise the event when a button is clicked.
private void myButton_Click(object sender, System.EventArgs e)
   if (myDataGridTableStyle.RowHeadersVisible)
      myDataGridTableStyle.RowHeadersVisible = false;
      myDataGridTableStyle.RowHeadersVisible = true;

.NET Framework
Available since 1.1
Return to top
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
© 2015 Microsoft