07-12-2023, 01:32 AM
(This post was last modified: 07-12-2023, 01:51 AM by Alexandre Machado.)
Hi Paul,
this modified example is working as it should. Please have a look:
GridControls.zip (Size: 54.84 KB / Downloads: 5)
The issue is: Whenever you create controls at runtime, always set the parent of the control. In the case of the grid, skipping this step works when rendering in a full post back (sync event) because of a "peculiarity" of the grid rendering mechanism when it has child controls. But it won't work in an async event. It won't work for any other parent either (i.e. if you create a IWCheckBox owned by the form and forget to make it the parent, it won't be visible, similar to what would happen in a desktop VCL application).
As a rule of thumb: whenever creating a control at runtime, first thing you do: set the parent.
If you don't mind I'd like to add this project of yours to our demo repository. It is a nice example on how to create such a grid
Cheers,
this modified example is working as it should. Please have a look:

The issue is: Whenever you create controls at runtime, always set the parent of the control. In the case of the grid, skipping this step works when rendering in a full post back (sync event) because of a "peculiarity" of the grid rendering mechanism when it has child controls. But it won't work in an async event. It won't work for any other parent either (i.e. if you create a IWCheckBox owned by the form and forget to make it the parent, it won't be visible, similar to what would happen in a desktop VCL application).
As a rule of thumb: whenever creating a control at runtime, first thing you do: set the parent.
If you don't mind I'd like to add this project of yours to our demo repository. It is a nice example on how to create such a grid

Cheers,