Home Forums WinForms controls Xceed Grid for WinForms Blink on cell change Reply To: Blink on cell change

User (Old forums)
Member
Post count: 23064

Here is how I accomplished the task. Forgive any typos…

_GridControl.ColumnAdded += new ColumnAddedEventHandler(GridControl_ColumnAdded);

void GridControl_ColumnAdded(object sender, ColumnAddedEventArgs e)
{
GridControl grid = sender as GridControl;
Column column = e.Column;
if (column != null)
{
grid.DataRowTemplate.Cells[column.Index].ValueChanged += new EventHandler(GridControl_ValueChanged);
}
}

void GridControl_ValueChanged(object sender, EventArgs e)
{
Cell cell = sender as Cell;
cell.BackColor = Color.Aqua;

Timer timer = new Timer();
timer.Interval = 500;
timer.Tick += new EventHandler(GridControl_OnBlinkTimer);
timer.Tag = cell;
timer.Start();
}

void GridControl_OnBlinkTimer(object sender, EventArgs e) {
Timer timer = sender as Timer;
if (timer != null)
{
timer.Stop();
timer.Dispose();

Cell cell = timer.Tag as Cell;
if (cell != null)
cell.ResetBackColor();
}
}

Imported from legacy forums. Posted by John (had 3047 views)