Is there a way how to add more than one component into VirtualTreeView's IVTEditLink editor ?
More than one component for IVTEditLink editor in VirtualTreeView
1.3k Views Asked by Knobik At
2
There are 2 best solutions below
3
On
Simply create your custom editors in OnCreateEditor event. Because this event provides Column parameter you can create different editors for different columns. E.g.:
procedure TForm1.OnCreateEditor(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; out EditLink: IVTEditLink);
begin
case Column of
0: EditLink := TColorEditLink.Create;
1: EditLink := TFontEditLink.Create;
//etc..
end;
end;
I would use a standalone form as an editor container and leave the
IVTEditLinkconcept for this purpose because:TPanelas an editor component container then you should consider to choose the rightParentof thatTPanel; the editor with many fields may overlap either the bounds rectangle of your virtual tree or even bounds of your formOnDeactivateevent to a form than toTPanelcomponentIVTEditLinkconcept at all because it looses its sense here; theIVTEditLinkwas designed for specific node and column editors rather than for the whole nodes; you can simply open the form editor when theOnEditingevent arrives, or at double click event etc.But if I didn't convince you of leaving the
IVTEditLinkconcept for node editing of more than one column then you can checkthis examplefor the implementation of a form as an editor forIVTEditLinkinterface.