Can you tell me why this is happening? I have the following code in the DBAdvgrid.checkboxclick - so if the state if the box is true the following should update one field in that records row.
The problem happens whe nthe dbadvgrid1.endupdate is called.
The records move around in the grid to a different order, wrong rows become checked. I have now realize the checking of the row is not useful at all because it does not stay with the dataset record when you scroll, so there is no point to it. But the records resorting on the endupdate i do not understand.
dbadvgrid1.BeginUpdate;
olistclientdataset.DisableControls;
if state = true then
begin
//showmessage('checked');
//showmessage(olistclientdataset.FieldByName('id').AsString);
olistclientdataset.Edit;
olistclientdataset.FieldByName('status').AsString := 'OACTIVE';
olistclientdataset.Post;
//dbadvgrid1.Cells[20,arow] := 'OACTIVE';
end else
begin
//showmessage('un-checked');
//showmessage(olistclientdataset.FieldByName('id').AsString);
olistclientdataset.Edit;
olistclientdataset.FieldByName('status').AsString := 'NOT ORDERED';
olistclientdataset.Post;
//dbadvgrid1.Cells[20,arow] := 'NOT ORDERED';
end;
olistclientdataset.EnableControls;
dbadvgrid1.EndUpdate;