Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TAdvStringGrid
How to add a TAdvGlowButton in a grid

Any TWinControl descendent can be hosted inside TAdvStringGrid. This is done by assigning the control to the grid.CellControls[col,row]: TWinControl property.

Example: to have a TadvGlowButton displayed in cell 2,3 you can use:
AdvStringGrid1.CellControls[2,3] := AdvGlowButton1;
Result:

If you want to move the control to another place on the form, destroy it, etc... that should happen from application code.

To destroy the control, use following code:

var
  ctrl: TControl;

ctrl := grid.CellControls[x,y];
if Assigned(ctrl) then
begin
  FreeAndNil(ctrl);
  grid.CellControls[x,y] := nil;
end;

The article that discusses cell controls can be found here: https://www.tmssoftware.com/site/asg57.asp