Hi!
I'm currently developing a Windows Forms application using Syncfusion's GridControl. The grid is updated every 250ms . But if one of the updated cells is selected, that cell value is not updated until I change the focus to another cell. Here's the code I'm using to notify which cells need to be updated.
Size _oldSize;
Graphics _graphics;
private void UpdateGridCell(int row, int col)
{
if (_oldSize != _gridControl.ClientSize)
{
if (_graphics != null)
_graphics.Dispose();
_graphics = null;
_oldSize = _gridControl.ClientSize;
}
if (_graphics == null)
_graphics = _gridControl.CreateGridGraphics();
GridRangeInfo range = GridRangeInfo.Cell(row, col);
if (range == _gridControl.CurrentCell.RangeInfo)
{
_gridControl.CurrentCell.Model.ResetActiveText(row, col);
}
else
{
Rectangle bounds = _gridControl.RangeInfoToRectangle(headerRange);
if (!bounds.IsEmpty)
{
_gridControl.DrawClippedGrid(_graphics, bounds);
}
}
}
PS: I extracted this code from Syncfusion performance samples.