Hi,
I have an UltraTree for which I made the node editable by setting LabelEdit and UseEditor to true.
Now I have a single TreeNode for which I want to disable this.
Tried to do it with AllowCellEdit = AllowCellEdit.Disabled, but after this, editing this TreeNode still works...
Any ideas?
Kind regards, Lieven Cardoen
AllowCellEdit is for cells within a node. It's for when the tree is displaying as a grid with cells and columns. So it doesn't affect LabelEdit, which is editing the entire node.
So what you need to do is this:
this.ultraTree1.Nodes[0].Override.LabelEdit = Infragistics.Win.DefaultableBoolean.False;
You could also handle the BeforeLabelEdit event and cancel it for any node(s) you want.
Superb, thx! By the way, doesn't Infragistics have a dozen examples about these kind of things so that I don't need to annoy you with possible kind of 'stupid' questions...?
Well, there are samples you can download and install with NetAdvantage. I'm not sure if there is one specifically for this particular case.
I'm sure there's documentation somewhere that talks about the Override object. Basically, there's an Override on the tree, the Nodes Collection, and the node, and also on the NodeLevelOverrides. So any property on the Override can be set at a variety of different levels and the more specific level (the node in this case) takes precedence over the mode general level (the tree in this case).
This allows you to set a property on the tree override to affect all nodes and then override (hence the name of the object) that property on a few nodes, or a single node. It works this way for all properties on the override with a few rare exceptions.
Oh, and we use this same sort've technique for a lot of the Infragistics Windows Forms control like the WinGrid and many others.