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
335
UltraCombo column , how to undo
posted

Hi

I have an ultracombo column on a grid. When I do the grids PerformAction(UltraGridAction.UndoCell) it does not set the combo item back to it's original value. Although, the value of the cell is set back to its original value when I look in code. For example:

I have a drop down with value like so

Value Member : Display Member

1                    :   One

2                    :   Two

say the value in the cell is currently 1 so the display reads One, I then choose Two but I have code to cancel that and also PerformAction(UndoCell) , what happens then is the cell shows value 1 but text 2 i.e:

1                   :   Two

How do I undo it properly?

Thanks

Paul

Parents
  • 29105
    Offline posted

    The undo operation has to occur while the cell is in edit mode since the grid does not keep track of these changes. 

    The best place to validate a cell is hooking cellchange. Alternatively you can just call e.Cell.CancelUpdate. 

    eg. 

    private void UltraGrid1_CellChange(object sender, CellEventArgs e)
    {
    if ((string)e.Cell.Text == "B")
    {
    e.Cell.CancelUpdate();

    or
    ultraGrid1.PerformAction(UltraGridAction.UndoCell);
    }
    }

Reply Children