HighTechTalks DotNet Forums  

Need Help; DataGrid, change cell color (blink/flash)

Dotnet Data Tools microsoft.public.dotnet.datatools


Discuss Need Help; DataGrid, change cell color (blink/flash) in the Dotnet Data Tools forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
=?Utf-8?B?QnJpYW5ESA==?=
 
Posts: n/a

Default Need Help; DataGrid, change cell color (blink/flash) - 06-13-2007 , 09:48 AM






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.


Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.