DataGridView.ColumnDataPropertyNameChanged イベント
定義
列の DataPropertyName プロパティの値が変更された場合に発生します。
public:
event System::Windows::Forms::DataGridViewColumnEventHandler ^ ColumnDataPropertyNameChanged;
public event System.Windows.Forms.DataGridViewColumnEventHandler ColumnDataPropertyNameChanged;
member this.ColumnDataPropertyNameChanged : System.Windows.Forms.DataGridViewColumnEventHandler
Public Custom Event ColumnDataPropertyNameChanged As DataGridViewColumnEventHandler
イベントの種類
例
このメンバーの使用例を次のコード例に示します。 この例では、イベントハンドラーがイベントの発生を報告し ColumnDataPropertyNameChanged ます。 このレポートは、イベントがいつ発生し、デバッグに役立つかを理解するのに役立ちます。 複数のイベントまたは頻繁に発生するイベントについてレポートするには、メッセージをに置き換えるか、または複数 MessageBox.Show Console.WriteLine 行に追加することを検討してください TextBox 。
コード例を実行するには、という名前の型のインスタンスを含むプロジェクトに貼り付け DataGridView DataGridView1
ます。 次に、イベントハンドラーがイベントに関連付けられていることを確認し ColumnDataPropertyNameChanged ます。
private void DataGridView1_ColumnDataPropertyNameChanged(Object sender, DataGridViewColumnEventArgs e) {
System.Text.StringBuilder messageBoxCS = new System.Text.StringBuilder();
messageBoxCS.AppendFormat("{0} = {1}", "Column", e.Column );
messageBoxCS.AppendLine();
MessageBox.Show(messageBoxCS.ToString(), "ColumnDataPropertyNameChanged Event" );
}
Private Sub DataGridView1_ColumnDataPropertyNameChanged(sender as Object, e as DataGridViewColumnEventArgs) _
Handles DataGridView1.ColumnDataPropertyNameChanged
Dim messageBoxVB as New System.Text.StringBuilder()
messageBoxVB.AppendFormat("{0} = {1}", "Column", e.Column)
messageBoxVB.AppendLine()
MessageBox.Show(messageBoxVB.ToString(),"ColumnDataPropertyNameChanged Event")
End Sub