DataGrid Cell (flash or blink) as values are changed in grid HELP

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi
I am trying to find a way to change the background color of a cell (flash or
blink) when its value has changed (by user or data update). I need to be
able to do this for more than one cell close to the same time. The code
example below works however, while it is running if another cell is changed,
it overrides it.

DataGridViewRow row;
DataGridViewCell dataCell;
private void dataGridView1_CellValueChanged(object sender,
DataGridViewCellEventArgs e)
{
row = dataGridView1.Rows[e.RowIndex];
dataCell = row.Cells[e.ColumnIndex];
ThreadPool.QueueUserWorkItem(new WaitCallback(CycleBGColor));
}
private void CycleBGColor(Object stateInfo)
{
dataCell.Style.BackColor = Color.Red;
Thread.Sleep(1000);
dataCell.Style.BackColor = Color.Pink;
Thread.Sleep(1000);
dataCell.Style.BackColor = Color.Red;
Thread.Sleep(1000);
dataCell.Style.BackColor = Color.Pink;
Thread.Sleep(1000);
dataCell.Style.BackColor = Color.Red;
Thread.Sleep(1000);
dataCell.Style.BackColor = Color.White;

}
The end game is; when one user changes the values, the changes will update
all other users data and the cells with new values will change (flash or
blink).

Thanks for any help.
Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top