Forum > Designer

TStringGrid: which event fires when checkbox is changed?

(1/2) > >>

wimpie:
Hi

I have a stringgrid containing a column of checkboxes. Which event does one use to be informed of boxes that have been checked/unchecked?

LazaruX:
You can use something like OnChange and then check if the checkbox is in the status you wished

wimpie:
I don't think TStringGrid has an OnChange event. There are OnChange events for properties such as BorerSpacing and Constraints.

There is OnEditingDone, but it doesn't fire for the checkbox cells.

jesusr:
Right, the grid didn't have a easy way to detect checkbox toggle, in Lazarus 23510 I have added a new event: OnCheckboxToggled it has an aState argument that indicates what was the final state of checkbox, this event is triggered for currently cell, ie, grid.col, grid.row.

wimpie:
Thank you. It helps me a lot.

I think it will be better if the Col and Row is also passed as parameters. It will reduce the code in the handler and be in line with the other grid events. But it is not critical. I will log a feature request on mantis.

Thanks again.

Navigation

[0] Message Index

[#] Next page

Go to full version