I am looking for the way of disabling proper nodes.
Let's say I have created simple treeview structure like below:
- Parent 1 (disable)
- Parent 2
- Child 1
- Child 2 (disable)
So far I have found workaround how to do that, but it still doesn't work good at all. I use OnChanging
event handler:
procedure TForm1.TreeViewChanging(Sender: TObject; Node: TTreeNode;
var AllowChange: Boolean);
begin
if (Node.Text = 'Parent 1') or (Node.Text = 'Child 1') then
AllowChange := False;
end;
It works, because I can't click on this node, but the issue is that after 'disabling' node this way, the color of Parent 1
and Child 1
nodes is the same as other. Is it any way to change color of this nodes (grey)? Or maybe you know another way to disabling nodes in TTreeView component?