adv grid button column

During edit of TTIWAdvWebGrid I have a Cell button which when pressed allows selection from a list in a called TIWAppForm. I want to set a column with the selected value. But if I move the selected value to Cells[ColumnIndex, ActiveRow] and the user Cancels edit then the original Cell value is not restored.

Is there a way to retain the original value?

Hi,


I'm not sure I understand your question correctly.
Are you assigning the selected value to the cell value? Then the original cell value is lost and can't be restored by the Cancel command.

Yes. I tried to save the old values and restore them in ItemsAdvGridCancel:

procedure TBenefitForm.ItemsAdvGridCancel(Sender: TObject);
    var j1: integer; begin
  with ItemsAdvGrid do for j1 := 0 to Columns.Count-1 do
    Cells[j1,ActiveRow] :=  old_values[j1];
  end;

This has no affect.

Can you try adding a call to AsyncUpdateAllCells in the Cancel event?

We'll have to investigate if this behavior can be improved in a future version of the TIWAdvWebGrid.

Example:

procedure TBenefitForm.ItemsAdvGridCancel(Sender: TObject);
    var j1: integer; begin
  with ItemsAdvGrid do for j1 := 0 to Columns.Count-1 do
    Cells[j1,ActiveRow] :=  old_values[j1];
    ItemsAdvGrid.AsyncUpdateAllCells;
  end;


<<Are you assigning the selected value to the cell value?>>

Is there a buffer other than Cells I can post to? Like:

PostData: TStringList;


Thanks