Windows Dev Center

Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DataGridTableStyle.RowHeaderWidth Property

Gets or sets the width of row headers.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in system.windows.forms.dll)

[LocalizableAttribute(true)] 
public int RowHeaderWidth { get; set; }
/** @property */
public int get_RowHeaderWidth ()

/** @property */
public void set_RowHeaderWidth (int value)

public function get RowHeaderWidth () : int

public function set RowHeaderWidth (value : int)

Not applicable.

Property Value

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);
}

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0

Community Additions

Show:
© 2015 Microsoft