DataGridColumnStyle.MappingNameChanged 事件
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
当 MappingName 值更改时发生。
public:
event EventHandler ^ MappingNameChanged;
public event EventHandler MappingNameChanged;
member this.MappingNameChanged : EventHandler
Public Custom Event MappingNameChanged As EventHandler
事件类型
示例
下面的代码示例演示了此成员的使用。
private:
void AddCustomColumnStyle()
{
DataGridTableStyle^ myTableStyle = gcnew DataGridTableStyle;
myTableStyle->MappingName = "Orders";
myColumnStyle = gcnew DataGridTextBoxColumn;
myColumnStyle->MappingName = "Orders";
myColumnStyle->HeaderText = "Orders";
myTableStyle->GridColumnStyles->Add( myColumnStyle );
myDataGrid->TableStyles->Add( myTableStyle );
myColumnStyle->MappingNameChanged += gcnew EventHandler( this, &MyForm::columnStyle_MappingNameChanged );
flag = (bool *)true;
}
// MappingNameChanged event handler of DataGridColumnStyle.
void columnStyle_MappingNameChanged( Object^ /*sender*/, EventArgs^ /*e*/ )
{
MessageBox::Show( "Mapping Name changed" );
}
private void AddCustomColumnStyle()
{
DataGridTableStyle myTableStyle = new DataGridTableStyle();
myTableStyle.MappingName = "Orders";
myColumnStyle = new DataGridTextBoxColumn();
myColumnStyle.MappingName="Orders";
myColumnStyle.HeaderText="Orders";
myTableStyle.GridColumnStyles.Add(myColumnStyle);
myDataGrid.TableStyles.Add(myTableStyle);
myColumnStyle.MappingNameChanged+=new EventHandler(columnStyle_MappingNameChanged);
flag=true;
}
// MappingNameChanged event handler of DataGridColumnStyle.
private void columnStyle_MappingNameChanged(object sender, EventArgs e)
{
MessageBox.Show("Mapping Name changed");
}
Private Sub AddCustomColumnStyle()
Dim myTableStyle As New DataGridTableStyle()
myTableStyle.MappingName = "Orders"
myColumnStyle = New DataGridTextBoxColumn()
myColumnStyle.MappingName = "Orders"
myColumnStyle.HeaderText = "Orders"
myTableStyle.GridColumnStyles.Add(myColumnStyle)
myDataGrid.TableStyles.Add(myTableStyle)
AddHandler myColumnStyle.MappingNameChanged, AddressOf columnStyle_MappingNameChanged
flag = True
End Sub
' MappingNameChanged event handler of DataGridColumnStyle.
Private Sub columnStyle_MappingNameChanged(ByVal sender As Object, ByVal e As EventArgs)
MessageBox.Show("Mapping Name changed")
End Sub