Export (0) Print
Expand All

DataGridTableStyle.RowHeaderWidth Property

Gets or sets the width of row headers.

[Visual Basic]
Public Property RowHeaderWidth As Integer
[C#]
public int RowHeaderWidth {get; set;}
[C++]
public: __property int get_RowHeaderWidth();
public: __property void set_RowHeaderWidth(int);
[JScript]
public function get RowHeaderWidth() : int;
public function set RowHeaderWidth(int);

Property Value

The width of row headers in pixels.

Remarks

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.

Example

[Visual Basic] 
Private Sub CallEventLoader()
   AddHandler Load, AddressOf DataGridTableStyle_RowHeaderWidth_Load
End Sub 'CallEventLoader


Public Sub AttachRowHeaderWidthChanged()
   AddHandler myDataGridTableStyle.RowHeaderWidthChanged, AddressOf MyDelegateRowHeaderChanged
End Sub 'AttachRowHeaderWidthChanged

Public Sub MyDelegateRowHeaderChanged(sender As Object, e As EventArgs)
   MessageBox.Show("Row header width is changed")
End Sub 'MyDelegateRowHeaderChanged


Private Sub button1_Click(sender As Object, e As EventArgs) Handles button1.Click
   myDataGridTableStyle.RowHeaderWidth = 30
End Sub 'button1_Click


Private Sub button2_Click(sender As Object, e As EventArgs) Handles button2.Click
   MessageBox.Show("Row header width is: " & myDataGridTableStyle.RowHeaderWidth)
End Sub 'button2_Click

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

public void AttachRowHeaderWidthChanged()
{
   myDataGridTableStyle.RowHeaderWidthChanged += 
                            new EventHandler(MyDelegateRowHeaderChanged);
}
public 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);
}

[C++] 
private:
    void CallEventLoader() {
        this->Load += new EventHandler(this, 
            &DataGridTableStyle_RowHeaderWidth::DataGridTableStyle_RowHeaderWidth_Load);
    }

public:
    void AttachRowHeaderWidthChanged() {
        myDataGridTableStyle->RowHeaderWidthChanged += 
            new EventHandler(this, &DataGridTableStyle_RowHeaderWidth::MyDelegateRowHeaderChanged);
    }

    void MyDelegateRowHeaderChanged(Object* /*sender*/, EventArgs* /*e*/) {
        MessageBox::Show(S"Row header width is changed");
    }

private:
    void button1_Click(Object* /*sender*/, System::EventArgs* /*e*/) {
        myDataGridTableStyle->RowHeaderWidth = 30;
    }

    void button2_Click(Object* /*sender*/, System::EventArgs* /*e*/) {
        MessageBox::Show(String::Concat(S"Row header width is: ",
            __box( myDataGridTableStyle->RowHeaderWidth)));
    }

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

DataGridTableStyle Class | DataGridTableStyle Members | System.Windows.Forms Namespace | RowHeadersVisibleChanged | RowHeadersVisible | RowHeaderWidthChanged

Show:
© 2014 Microsoft