Hi, I'm seeing some odd behaviour with TAdvStringGrid when using the OnEditingDone event handler, where I read the cell values and then write them straight back again. Clicking on one cell to select it, again to edit it, and then clicking on another cell causes the text from the first cell to be shown in the second.
The reason I want to do this in the event handler is that changing some values may cause changes to other values, so I basically want to refresh the whole grid.
Code to demonstrate is below. Regards, Robin.
__fastcall TTestForm::TTestForm(TComponent* Owner)
: TForm(Owner)
{
// set up grid
OptionsGrid->Options << goEditing;
// add some values
OptionsGrid->Cells[1][1] = "one";
OptionsGrid->Cells[1][2] = "two";
}
void __fastcall TTestForm::OptionsGridEditingDone(TObject *Sender)
{
String s1 = OptionsGrid->Cells[1][1];
String s2 = OptionsGrid->Cells[1][2];
// s1/s2 may be manipulated here ...
OptionsGrid->Cells[1][1] = s1;
OptionsGrid->Cells[1][2] = s2;
}