Overriding TwwDBGrid.ToggleCheckBox method in a descendant class
I created a descendant class inherited from TwwDBGrid, and now I need to do some actions just after TwwDBGrid.ToggleCheckBox() is executed.
But, ToggleCheckBox() isn't a virtual or dynamic method, and I can't override it.
What is the best way to do this?
Best regards.
Laercio
-
You can detect a field value change using the OnFieldChanged event. This should fire after you toggle the checkbox. Note: If you need to override, you would use the DoFieldChanged event.
procedure TBtnGridForm.wwDBGrid1FieldChanged(Sender: TObject; Field: TField);
begin
if (Field<>nil) and (Field.fieldName = 'Buyer') then
// Value changedend;
-
Ok, I'll try this approach.
By the way, all that I need is to do an auto post when the user clicks on a checkbox field on the grid.
So, I think that ToggleCheckBox() is the best place to do this, and I think that having an option flag on TwwDBGrid for this would be a good feature on a future release.
Thanks Roy.
Please sign in to leave a comment.
Comments
2 comments