If I include the showmessage in the event of TDBAdvGrid, it will freeze and wait a long time to display the message. Seems something blocking or the thread related.. Any idea ? Thanks.
You should not use ShowMessage from OnCellValidate.
Stopping cell editing is triggered by a focus leave. If you call ShowMessage(), you take the focus away from the grid inplace editor and that in itself will again affect the end of editing.
If you need to show a message, do this from the event OnCellEditDone, which is triggered after the editing itself properly ended.
If I remark all the code in the event 'OnGetCellColor' then the showMessage can be display. If there are codes inside this event, then it will freeze if call ShowMesssage(.....).
Why ?
Pls advise and how to get around on it.
Thanks.
I have explained you should NOT use ShowMessage in OnCellValidate and I explained the reason.
No.
I have a confirmation dialog ask user to confirm delete this record or not by calling 'MessageDLG('Are you sure to delete it ?', mtConfirmation, [mbOK], 0);', then it will freeze.... If I remove those codes in OnGetCellColor then it can show the dialog.
How was I supposed to know you trigger the MessageDlg now (apparently no longer a ShowMessage?!) from a button?!
In addition, your code in comment is partial. It is an image. I can do nothing with code in an image. I will not type over code from an image.
Isolate this problem in a standalone project and send this project with code I can compile here for investigation.
send to your personal email ? what is the email address ?
sent to you via email. Thanks.
I solved it by adding a global variables which enable or disable to execute the event 'OnGetCellColor'. It worked.