現在、XML ファイルから読み取る DataSet にバインドされている DataGridView があります。
DataGridView に問題なくデータを入力します。最後の列は、行への変更をコミットするためにユーザーがクリックするボタンです。
どの行が汚れているかは簡単に見つけることができますが、汚れた行内のどのセル自体が汚れているかを見つけるのに苦労しています。
ダーティ行内の各セルを反復処理しましたが、ダーティとして表示されません。
どんな考えでも大歓迎です!
if ( this.inventoryGridView.Columns[e.ColumnIndex].Name == "itemCheckedIn" )
{
// Give the user a visual indicator the cells are "locked"/readonly by changing the background color
this.inventoryGridView.Rows[e.RowIndex].DefaultCellStyle.BackColor = Color.LightGray;
// Check if any changes have been made to the row that was checked in
if ( this.inventoryGridView.IsCurrentRowDirty )
{
foreach ( DataGridViewCell dirtyBoy in this.inventoryGridView.CurrentRow.Cells )
{
// Is he dirty?
}
}
// No changes were made to the row that was check in; let's log the check in
else
{
// Log the check in time
}