I have 2 grids on form.
1 - Main data.
2 - Slave data. Data changes all time when I change maindata row.
If I edit data in slave grid and after editing make click in same (slave) grid -- all is fine.
Only if after editing I make click on maindata grid, I get:
at first: FastMM error: error during GetMem operation. Block has been modified being freed
at second: system error: Out of memory.
Problem with ediing data in grid
-
- Newbie
- Posts: 14
- Joined: Thu Aug 03, 2017 12:00 am
Re: Problem with ediing data in grid
Problem resolved (partly) by adding the following code:
onCellEdited not fired before onExit event.
It's still a problem. In this example, the data entered by the user is destroyed. How to store them?
Code: Select all
procedure TMainForm.tgrdAttributesCellEdited(const Sender: TObject;
const AEditor: TControl; const AColumn: TColumn; const ARow: Integer;
var ChangeData: Boolean; var NewData: string);
begin
if MainForm.Focused.GetObject <> tgrdAttributes then
ChangeData:= False;
end;
It's still a problem. In this example, the data entered by the user is destroyed. How to store them?
-
- Newbie
- Posts: 14
- Joined: Thu Aug 03, 2017 12:00 am
Re: Problem with ediing data in grid
NB. I use FMX.
Re: Problem with ediing data in grid
Hello,
Could you please arrange a simple example so we can reproduce the problem here?
Thanks in advance.
Could you please arrange a simple example so we can reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 14
- Joined: Thu Aug 03, 2017 12:00 am
Re: Problem with ediing data in grid
Exact error duplication:
A) Select the first line of mastergrid (Left grid).
b) Edit slave cell (right grid).
c) Left the changed cell with the mouse and click on the mastergrid last line.
A slightly different error occurs when after edit click mastergrid second or third line.
Demo location: https://www.online.ee/sharefile.php?sha ... 8249e07f9f
A) Select the first line of mastergrid (Left grid).
b) Edit slave cell (right grid).
c) Left the changed cell with the mouse and click on the mastergrid last line.
A slightly different error occurs when after edit click mastergrid second or third line.
Demo location: https://www.online.ee/sharefile.php?sha ... 8249e07f9f
Re: Problem with ediing data in grid
Hello,
You are copying your original data to MainSlaveData everytime you select a new row in the main grid. This is overriding the changes in MainSlaveData.
Instead, you could use an array to access your slave data. Ie:
You are copying your original data to MainSlaveData everytime you select a new row in the main grid. This is overriding the changes in MainSlaveData.
Instead, you could use an array to access your slave data. Ie:
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |