I have a Virtual Treeview (e.g. TVirtualStringTree
).
- The user can select a row
- but it would be nice if they could also do the intuitiave thing of clicking "nowhere" to select no row
Note: Of course multiselect is off; because they can only select zero or one items
MCRE:
procedure TForm6.FormCreate(Sender: TObject);
var
vst: TVirtualStringTree;
begin
vst := VirtualStringTree1;
vst.RootNodeCount := 5;
vst.TreeOptions.SelectionOptions := vst.TreeOptions.SelectionOptions + [toFullRowSelect];
vst.Header.Options := vst.Header.Options + [hoVisible];
vst.Header.Columns.Add;
vst.Header.Columns.Add;
vst.Header.Columns.Add;
vst.Header.Columns.Add;
vst.Header.Columns.Add;
end;