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(

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: " + 

.NET Framework
Available since 1.1
Return to top