DataGrid.ParentRowsLabelStyleChanged 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
在更改父行的标签样式时发生。
public:
event EventHandler ^ ParentRowsLabelStyleChanged;
public event EventHandler ParentRowsLabelStyleChanged;
member this.ParentRowsLabelStyleChanged : EventHandler
Public Custom Event ParentRowsLabelStyleChanged As EventHandler
事件类型
示例
下面的代码示例演示了此成员的使用。
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" );
}
private void CallParentRowsLabelStyleChanged()
{
myDataGrid.ParentRowsLabelStyleChanged +=
new EventHandler(DataGridParentRowsLabelStyleChanged_Clicked);
}
// Set the 'ParentRowsLabelStyle' property on click of a button.
private void ToggleStyle_Clicked(object sender, EventArgs e)
{
if (myDataGrid.ParentRowsLabelStyle.ToString() == "Both")
myDataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName;
else
myDataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both;
}
// raise the event when 'ParentRowsLabelStyle' property is changed.
private 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 += myLabelStyle;
MessageBox.Show(myMessage, "ParentRowsLabelStyle information");
}
Private Sub CallParentRowsLabelStyleChanged()
AddHandler myDataGrid.ParentRowsLabelStyleChanged, AddressOf _
DataGridParentRowsLabelStyleChanged_Clicked
End Sub
' Set the 'ParentRowsLabelStyle' property on click of a button.
Private Sub ToggleStyle_Clicked(ByVal sender As Object, ByVal e As EventArgs)
If myDataGrid.ParentRowsLabelStyle.ToString() = "Both" Then
myDataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.TableName
Else
myDataGrid.ParentRowsLabelStyle = DataGridParentRowsLabelStyle.Both
End If
End Sub
' raise the event when 'ParentRowsLabelStyle' property is changed.
Private Sub DataGridParentRowsLabelStyleChanged_Clicked(ByVal sender As Object, ByVal e As EventArgs)
Dim myMessage As String = "ParentRowsLabelStyleChanged event raised, LabelStyle is : "
' Get the state of 'ParentRowsLabelStyle' property.
Dim myLabelStyle As String = myDataGrid.ParentRowsLabelStyle.ToString()
myMessage += myLabelStyle
MessageBox.Show(myMessage, "ParentRowsLabelStyle information")
End Sub