From the previous question i have asked related to color text change after edit. now i have been requested that i should not highlight the edited text.
this is what i want now.
1.Load existing file with the data to the datagridview 2.After loading,datagridview will populate data 3.The user will edit text from any cell 4.After editing the text, 5.Background cell of the edited text will change color to red, 6.Only for the edited cell,
How can i change the background cell of the edited text from the datagridview ?
This is what i tried by changing the background color of the cell.
private void Gridview_Output_CellBeginEdit_1(object sender, DataGridViewCellCancelEventArgs e)
{
DataGridViewCell cell = Gridview_Output[e.ColumnIndex, e.RowIndex];
cell.Tag = cell.Value != null ? cell.Value : "";
if (cell.OwningColumn.Name == "ValueOut")
cell.Style.BackColor = Color.Yellow;
}
Aucun commentaire:
Enregistrer un commentaire