DataGrid::ParentRowsLabelStyleChanged Event

 

Occurs when the label style of the parent row is changed.

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

public:
event EventHandler^ ParentRowsLabelStyleChanged {
	void add(EventHandler^ value);
	void remove(EventHandler^ value);
}

The following code example demonstrates the use of this member.

private:
   void CallParentRowsLabelStyleChanged()
   {
      myDataGrid->ParentRowsLabelStyleChanged += gcnew EventHandler( this, &MyForm::DataGridParentRowsLabelStyleChanged_Clicked );
   }

   // Set the 'ParentRowsLabelStyle' property on click of a button.
   void ToggleStyle_Clicked( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      if ( myDataGrid->ParentRowsLabelStyle.ToString()->Equals( "Both" ) )
            myDataGrid->ParentRowsLabelStyle = DataGridParentRowsLabelStyle::TableName;
      else
            myDataGrid->ParentRowsLabelStyle = DataGridParentRowsLabelStyle::Both;
   }

   // raise the event when 'ParentRowsLabelStyle' property is changed.
   void DataGridParentRowsLabelStyleChanged_Clicked( Object^ /*sender*/, EventArgs^ /*e*/ )
   {
      String^ myMessage = "ParentRowsLabelStyleChanged event raised, LabelStyle is : ";

      // Get the state of 'ParentRowsLabelStyle' property.
      String^ myLabelStyle = myDataGrid->ParentRowsLabelStyle.ToString();
      myMessage = String::Concat( myMessage, myLabelStyle );
      MessageBox::Show( myMessage, "ParentRowsLabelStyle information" );
   }

.NET Framework
Available since 1.1
Return to top
Show: