スポンサーリンク
スポンサーリンク

DataGridView 入力チェック

Visual Studio 2008

DataGridViewのDataErrorイベントハンドラに、以下のコードを加えるだけで、入力型エラー程度はハンドリングできる。

private void DataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs anError)
{
    if (anError.Exception.Message.Length > 0)
        MclsLogin.MsgBoxShow(this.Text, 32004, anError.Exception.Message);
}

コメント

タイトルとURLをコピーしました