I am trying to use the new ControlContainerEditor to allow me to use my custom control as the control that gets dropped down when a tree node goes into edit mode. I have instantiated my editor and set it as the EditingControl on the ControlContainerEditor but I it never shows up, and the node never goes into edit mode. There is no sample code given for doing this with tree nodes, only grids. Can you please post a small sample of how to do this?
thanks
There is a sample that demonstrates how to do this, though it's contained within the Editors section of the samples. When you run the sample, the bottom-right GroupBox is the sample you're interested in, while in the solution the UltraTree Host folder contains the relevant logic.
-Matt
thanks for that info, but that is not the same as I was asking for. I dont have columns in my tree, just single nodes that I want to display a drop down containing my custom control as an editor when the user clicks the tree node. I dont want the node height to be the height of the editor, it should remain the same default size. Can you provide a snippet of how to get a UltraTreeNode to be the host of the dropdown with the custom editor. I cant even seem to get the node to go into edit mode despite setting CellClickAction, LabelEdit, and AllowCellEdit to the appropriate values.
Since you are not using cells (columns), CellClickAction and AllowCellEdit have no meaning here. The only thing you need to set to make the nodes editable is LabelEdit.
To get a dropdown in a node, you can use UltraTextEditor. Use the ButtonsRight collection to add a DropDownEditorButton and assign a Control to it. Then set the EditorControl on the node's Override to the UltraTextEditor.
OK I tried using a simple UltraTextEditor and added a button to the ButtonsRight collection, and set the dropdown button's control to my custom editor. I see the drop down button on each node, but it never drops down or enters edit mode. I must be missing some setting...here is what I have
private void Form1_Load(object sender, EventArgs e){
DropDownEditorButton b = new DropDownEditorButton();b.Control = myEditorControl1;ultraTextEditor1.ButtonsRight.Add(b);ultraTree1.Override.EditorComponent = ultraTextEditor1;ultraTree1.Override.UseEditor = DefaultableBoolean.True;ultraTree1.Override.ShowEditorButtons = ShowEditorButtons.Always;ultraTree1.Override.LabelEdit = DefaultableBoolean.True;}
What else do I have to set to made the nodes start to edit?
thanks!
Hi,
Hm, I'm not sure why it's not working for you. I just tested this out with basically the same code you have here and it works fine for me.
I'm attaching my test sample so you can run it and see if the same code works for you.
I got it working using your example but that is not the look and fell I was trying to achieve...
I would prefer if you simply expanded a nodes expansion indicator...a user control would appear...
The whole editor thing is work around that doesn't work for me...
I wish you guys would simply include a control property and node type that accommodated replacing the node's nodes collection with a pane or panel to dump a control onto...
This would vastly improve the usability of the tree control...
Carson
Hi Carson,
Did you try my sample in v8.3? Just change the project reference to point to the versions of the assemblies on your machine. You will also need to change EditorComponent to EditorControl.
I tried it out and it works fine for me. If my sample doesn't work for you on your machine, then my guess is that you are using an older version of the assemblies and you need to get the latest service release.
How to get the latest service release - Infragistics Community
I am using V2 8.3 and it does not drop down for me using the following:
UltraTreeNode addNode; addNode = rootNode.Add("fields", "Fields"); addNode.Override.EditorControl = this.ultraTextEditor1; addNode.Override.UseEditor = Infragistics.Win.DefaultableBoolean.True; addNode.Override.ShowEditorButtons = ShowEditorButtons.Always; addNode.Override.LabelEdit = Infragistics.Win.DefaultableBoolean.True; treeTerrains.Nodes.Add(rootNode);
The text editor has its button and a second tree control as the contained control for that button...