2011年2月22日火曜日

.NET DataGridView.CellValidatingイベントによる入力値の検証

.NET DataGridView.CellValidatingイベントによる入力値の検証

詳しくは DOBON.NET 様の
DataGridViewのセルに入力された値が正しいか確かめる を参照

e.FormattedValue で入力値を取得できる。

DataGrideViewから取得したい場合は
DataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).EditedFormattedValue で取得する。

DataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).Value や
DataGridView.Rows(e.RowIndex).Cells(e.ColumnIndex).FormattedValue には
入力前の値が入っている。

0 件のコメント:

コメントを投稿