Recent

Author Topic: Tstringgrid OnEditingDone  (Read 4509 times)

acp693

  • Jr. Member
  • **
  • Posts: 73
Tstringgrid OnEditingDone
« on: November 10, 2010, 03:46:39 pm »
Hello,

I'm using the OnEditingDone method to update parts of my program when I manually edit cells. However, the OnEditingDone method is also being called when my program  writes strings to the StringGrid programmatically. My question: is it possible to prevent this?

Best regards

Albert

typo

  • Hero Member
  • *****
  • Posts: 3051
Re: Tstringgrid OnEditingDone
« Reply #1 on: November 10, 2010, 03:57:32 pm »
Well, you could set a CanExecuteEventHandler boolean variable to not allow execution of you code when it is made programmatically.

So you do:

Code: [Select]
CanExecuteEventHandler := False;
// your code to edit programmatically
CanExecuteEventHandler := True;

and in your event handler you do:

Code: [Select]
if CanExecuteEventHandler then
// your code

Where is your imagination?
« Last Edit: November 10, 2010, 04:09:14 pm by typo »

acp693

  • Jr. Member
  • **
  • Posts: 73
Re: Tstringgrid OnEditingDone
« Reply #2 on: November 10, 2010, 04:35:15 pm »
Ah, yes, I just thought there might be some way of arranging StringGrid that would only allow the method when it is manually edited.

Thanks

Albert

 

TinyPortal © 2005-2018