Recent

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

Blaazen

  • Hero Member
  • *****
  • Posts: 3237
  • 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 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

zeljko

  • Hero Member
  • *****
  • Posts: 1596
    • 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: 3237
  • 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 2.3.0 (rev main-2_3-2863...) FPC 3.3.1 x86_64-linux-qt Chakra, Qt 4.8.7/5.13.2, Plasma 5.17.3
Lazarus 1.8.2 r57369 FPC 3.0.4 i386-win32-win32/win64 Wine 3.21

Try Eye-Candy Controls: https://sourceforge.net/projects/eccontrols/files/

Edson

  • Hero Member
  • *****
  • Posts: 1302
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 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Cyrax

  • Hero Member
  • *****
  • Posts: 836
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: 1302
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 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

 

TinyPortal © 2005-2018