* * *

Author Topic: OnEditingDone Events in TStringGrid  (Read 7301 times)

Blaazen

  • Hero Member
  • *****
  • Posts: 2370
  • POKE 54296,15
    • Eye-Candy Controls
OnEditingDone Events in TStringGrid
« on: May 06, 2009, 06:06:31 pm »
Hello,
I have TStringGrid on my form, property AutoEdit is set to True, option goEditing is also True and option goAlwaysShowEditor may be True or False, no matter. When a cell of my grid is in editing mode and i leave it (I click on the next cell, for example) the OnEditingDone event is launched three times! Is it bug or some delphi legacy? I think it is not very efficient launch some event three times. OK, I can do a little workaround:

procedure TGrid.OnEditingDone(Sender: TObject);
begin
if grid.modified then
  begin
     grid.modified:=false;
     .....my code...
  end;
end;
(this makes my code run only once)


but does anyone know better way how to avoid it?
Thanks for your ideas.

I forgot to write that it's Lazarus 0.9.26 on Win Vista.
« Last Edit: May 07, 2009, 11:52:33 am by Blaazen »
Lazarus 1.7 r52036M FPC 3.0.0 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.5
Lazarus 1.4RC3 r48629 FPC 2.6.4 i386-win32-win32/win64 Wine 1.7.43
Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zeljko

  • Hero Member
  • *****
  • Posts: 888
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: OnEditingDone Events in TStringGrid
« Reply #1 on: February 04, 2011, 08:20:25 pm »

Blaazen

  • Hero Member
  • *****
  • Posts: 2370
  • POKE 54296,15
    • Eye-Candy Controls
Re: OnEditingDone Events in TStringGrid
« Reply #2 on: February 04, 2011, 09:21:10 pm »
Zeljko, you have great memory!  :) It is post from June 2009  :).

AFAIR I didn't use this method in my grids finally.

Will this patch be in some near SVN ?

If yes then I will test it and maybe I will do some revision on my code.
Lazarus 1.7 r52036M FPC 3.0.0 x86_64-linux-qt Chakra, Qt 4.8.7, Plasma 5.5
Lazarus 1.4RC3 r48629 FPC 2.6.4 i386-win32-win32/win64 Wine 1.7.43
Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Edson

  • Hero Member
  • *****
  • Posts: 668
Re: OnEditingDone Events in TStringGrid
« Reply #3 on: February 23, 2017, 05:53:48 am »
Just for information: Six year later and I still experiment problems with several calls on OnEditingDone and OnGetEditText.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

Cyrax

  • Sr. Member
  • ****
  • Posts: 481
Re: OnEditingDone Events in TStringGrid
« Reply #4 on: February 23, 2017, 08:31:40 am »
Please post a follow up in that linked bug report and ask applying the patch to the trunk if it solves the problem.

Edson

  • Hero Member
  • *****
  • Posts: 668
Re: OnEditingDone Events in TStringGrid
« Reply #5 on: February 23, 2017, 04:47:52 pm »
The bug reported in http://bugs.freepascal.org/view.php?id=18686, is another problem with TStringGrid. Maybe related (maybe not) to the reported here.

I can confirm the bug reported there, is still happening in my system.

It seems TStringGrid is flawed, at least with the editing options. I had to implement my own OnEditingDone and OnGetEditText, to make it works.
Lazarus 1.6 - FPC 3.0.0 - x86_64-win64 on  Windows 7

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus