質問

I have task,in my datagridview if i delete one row, that row will change the back color not delete in database until operations(update or save) commited. How can do this.?

役に立ちましたか?

解決

It is difficult to provide a complete answer due to lack of information and code in your question. You might need something like this.

private void dataGridView1_UserDeletingRow(object sender, DataGridViewRowCancelEventArgs e)
{
    e.Cancel = true;
    dataGridView1.CurrentRow.DefaultCellStyle.BackColor = Color.LightGreen;
}

Follow these links. I think they maybe useful for you to solve your issue.

UserDeletingRow event (fires when a row is about to get deleted)

DefaultCellStyle property (to change the BackColor of the CurrentRow)

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top