Export (0) Print
Expand All

DataGridTableStyle.RowHeaderWidth Property

Gets or sets the width of row headers.

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

public int RowHeaderWidth { get; set; }

Property Value

Type: System.Int32
The width of row headers, in pixels.

When row headers are visible a plus sign is displayed in each row header if the underlying data 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.


private void CallEventLoader()
{
   this.Load += new EventHandler(
      this.DataGridTableStyle_RowHeaderWidth_Load);
}

public void AttachRowHeaderWidthChanged()
{
   myDataGridTableStyle.RowHeaderWidthChanged += 
                            new EventHandler(MyDelegateRowHeaderChanged);
}
private void MyDelegateRowHeaderChanged(object sender, EventArgs e)
{
   MessageBox.Show("Row header width is changed");
}

private void button1_Click(object sender, System.EventArgs e)
{  
   myDataGridTableStyle.RowHeaderWidth = 30;
}

private void button2_Click(object sender, System.EventArgs e)
{
   MessageBox.Show("Row header width is: " + 
                       myDataGridTableStyle.RowHeaderWidth);
}


.NET Framework

Supported in: 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

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

Community Additions

ADD
Show:
© 2015 Microsoft