Export (0) Print
Expand All

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";
   else
      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;
   else
      myDataGridTableStyle.RowHeadersVisible = true;
}

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft