Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

TLMDGrid OnAfterChange-Event missing

Hello,
I use the LMD tools 2015 and have a TLMDGrid object on a form. The grid contains i.a. a checkbox column.
 
After the value in one of these checkbox cells has been changed by the user, a procedure should be executed.

I could not find an appropriate event procedure ("OnAfterChange").
In the OnChange procedure, as far as I can see, the Before-Update value is returned; if you click on it several times, the OnChange-Prozudur will not run at all anymore.

The OnClick procedure is similar.

I suspect that the OnChange or OnClick procedure applies only to the entire grid, but not to the single cell or column.

With "CurrentColumn" and "CurrentRow" I can identify the respective cell (if one of the above-mentioned OnChange procedures is run through, but the value of the cell is the before-change value.

My question is:
How can I implement the program so that every time a checkbox is changed, the desired procedure is called and the new value is passed?

Thanks in advance for your answers.
Bernhard
Tagged:

Comments

  • 4 Comments sorted by Votes Date Added
  • You are right, currently there no event, which can be used to detect internal data change. I've added cfData member to TLMDGridChangeFlag enumeration used in OnChange event to allow interception of internal data source changes.

    However, it important to note that underlaying data is not changed at the moment you click on cell check box. At this time row is switched to "editing" mode, and modified cell value is stored inside "inplace editor". Editor's value will be flushed to data store when another cell is selected or when Ctrl+Enter key pressed. 

    Moreover, non-flushed editor's value can be rejected pressing Escape key.
  • Hi,
    there is now a procedure to set the checkstate after clicking without changing to another celle . it is unusual for users to confirm an obviously checked field still by changing to another field.
    best regards
    Gerd
  • edited February 2021 Posts: 0 Accepted Answer Vote Up0Vote Down
    There is the EndEditing(ACommit: Boolean) method. You can try to use it. But, anyway, the grid was desgned with the "modifying row" concept in mind.
Sign In or Register to comment.