Home Forums WinForms controls Xceed Grid for WinForms Blink on cell change

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15657 |

    Is there a built-in feature to blink a cell or row? I noticed there is such functionality when there is a cell value validation error – can that be used when the value simply changes? Otherwise, I can implement the cell blinking functionality using timers, but the built-in mechanism would be preferred.

    Thanks,

    John

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

    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)

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.