Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

DataGridTableStyle.RowHeadersVisible Property

Gets or sets a value indicating whether row headers are visible.

[Visual Basic]
Public Property RowHeadersVisible As Boolean
[C#]
public bool RowHeadersVisible {get; set;}
[C++]
public: __property bool get_RowHeadersVisible();
public: __property void set_RowHeadersVisible(bool);
[JScript]
public function get RowHeadersVisible() : Boolean;
public function set RowHeadersVisible(Boolean);

Property Value

true if row headers are visible; otherwise, false. The default is true.

Remarks

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.

Example

[Visual Basic] 
' Instantiate the EventHandler.
Public Sub AttachRowHeaderVisibleChanged()
   AddHandler myDataGridTableStyle.RowHeadersVisibleChanged, AddressOf MyDelegateRowHeadersVisibleChanged
End Sub 'AttachRowHeaderVisibleChanged


' raise the event when RowHeadersVisible property is changed.
Public Sub MyDelegateRowHeadersVisibleChanged(sender As Object, e As EventArgs)
   Dim myString As String = "'RowHeadersVisibleChanged' event raised, Row Headers are"
   If myDataGridTableStyle.RowHeadersVisible Then
      myString += " visible"
   Else
      myString += " not visible"
   End If 
   MessageBox.Show(myString, "RowHeader information")
End Sub 'MyDelegateRowHeadersVisibleChanged


' raise the event when a button is clicked.
Private Sub myButton_Click(sender As Object, e As System.EventArgs)
   If myDataGridTableStyle.RowHeadersVisible Then
      myDataGridTableStyle.RowHeadersVisible = False
   Else
      myDataGridTableStyle.RowHeadersVisible = True
   End If
End Sub 'myButton_Click 

[C#] 
// Instantiate the EventHandler.
public void AttachRowHeaderVisibleChanged()
{
   myDataGridTableStyle.RowHeadersVisibleChanged += new EventHandler (MyDelegateRowHeadersVisibleChanged);
}

// raise the event when RowHeadersVisible property is changed.
public 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;
}

[C++] 
// Instantiate the EventHandler.
public:
void AttachRowHeaderVisibleChanged() {
    myDataGridTableStyle->RowHeadersVisibleChanged += 
        new EventHandler (this, &MyDataGridTableStyle_RowHeadersVisibleChanged::MyDelegateRowHeadersVisibleChanged);
}

// raise the event when RowHeadersVisible property is changed.
void MyDelegateRowHeadersVisibleChanged(Object* /*sender*/, EventArgs* /*e*/) {
    String* myString = S"'RowHeadersVisibleChanged' event raised, Row Headers are";
    if (myDataGridTableStyle->RowHeadersVisible)
        myString = String::Concat(myString, S" visible");
    else
        myString = String::Concat(myString, S" not visible");

    MessageBox::Show(myString, S"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;
}

[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 | RowHeaderWidth

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.