Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
Cell not refreshed immediately when value changed
posted

Hi IG,

I have this code:

private void _grid_KeyDown(object sender, KeyEventArgs e)
{
        //delete key = clear the current cell
        if (e.KeyCode == Keys.Delete || e.KeyCode == Keys.Back)
        {
                if (0 == (_grid.CurrentState & UltraGridState.InEdit))
                    if (_grid.ActiveCell != null)
                            if (_grid.ActiveCell.Value is CellClass)
                                (_grid.ActiveCell.Value as CellClass).Clear();
        }
}

The problem is, the cell is not refreshed/repainted until you move the mouse over, or scroll/resize the column, etc.
Cell is displayed as string, and CellClass has ToString() via IConvertible.

I tried adding BeginInvoke() around -> no success.
I tried _grid.ActiveCell.Refresh() -> no success.
I tried _grid.Invalidate(_grid.ActiveCell.GetUIElement().Rect) -> no success.
I tried reassign the same value to the ActiveCell  -> no success.

I debugged, and the ActiveCell.Text immediately changes to "" after calling Clear().

What could be the problem? Thanks.

Parents
  • 21795
    Offline posted

    Hello Michael,

    Thank you for contacting Infragistics Support.

    In order to give you my best possible solution for your issue can you please give me a little more information regarding your case:

       1) How you have implemented your CellClass?

       2) Have you implemented INotifyPropertyChangedinterface in your CellClass?

       3) Did you call the PropertyChanged event in your custom CellClass?

    It will help if you can provide a small, isolated sample application that demonstrates the behavior you are experience.

    Waiting for your feedback.

Reply Children