vcl-dxcustomtilecontrol-dot-tdxtilecontrolitemdetailoptions-cf5acf48.md
Associates a control to be displayed by a detail page on tile activation.
property DetailControl: TWinControl read; write;
| Type |
|---|
| TWinControl |
Use this property to associate a tile item with a detail control (any TWinControl descendant, for instance, TFrame). Activating the tile item using either a click or tap will display the associated detail control in a detail page.
With the DetailControl property, you can vary tile activation results for individual tile items, making them context-sensitive or conditional. For example, you can handle a tile item’s OnActiveFrameChanged event to switch the DetailControl property value based on the currently active tile frame, as shown below.
procedure <Form>.<TileControlItem>.ActiveFrameChanged(Sender: TdxTileControlItem)
var
ADetailControl: TWinControl;
begin
case Sender.ActiveFrameIndex of
1: ADetailControl := Panel2;
2: ADetailControl := Panel3;
else
ADetailControl := Panel1;
end;
Sender.DetailOptions.DetailControl.Visible := False;
Sender.DetailOptions.DetailControl := ADetailControl;
end;
void __fastcall TForm1::dxTileControl1Item1ActivateFrameChanged(TdxTileControlItem *Sender)
{
TWinControl *ADetailControl;
switch(Sender->ActiveFrameIndex)
{
case 1: ADetailControl = Panel2; break;
case 2: ADetailControl = Panel3; break;
default: ADetailControl = Panel1; break;
}
Sender->DetailOptions->DetailControl->Visible = false;
Sender->DetailOptions->DetailControl = ADetailControl;
}
This code example rotates TPanel objects (Panel1, Panel2, and Panel3) as a tile item’s detail control.
You can programmatically show or close detail pages via a tile item’s ActivateDetail and DeactivateDetail methods. To respond to item activations, handle a tile item’s OnActivateDetail and OnDeactivateDetail events.
See Also
TdxTileControlItemDetailOptions Class