I have a Textbox with a DropDownEditorButton that is related to a ultraTree.
I need to make the ultraTree appear once it receives the focus, as if I had clicked on DropDownEditorButton
You can call the DropDown method on the DropDownEditorButton to drop it down programmatically.
DropDownEditorButton ddeb = (DropDownEditorButton)this.ultraTextEditor1.ButtonsRight[0];ddeb.DropDown();
In the event ENTER of the textbox I get the error: 'The associated editor must be in edit mode to be dropped down.
and In the event GOT FOCUS of the textbox nothing happens.
In the event AFTER ENTER EDIT MODE A UltraTree appears and receives focus, but when I press tab again he would generate an error pointing to the ddeb.DropDown ()
I discovered the problem inadvertently. The following code in my form's Activated event caused the error to happen:
If Me.appAbasOpcoes.SelectedTab.Index = 0 Then Me.txtNDocReceita.Focus () Me.appAbasOpcoes.SelectedTab.Index = 1 Then ElseIf Me.txtNDocDespesa.Focus () Me.appAbasOpcoes.SelectedTab.Index = 2 Then ElseIf Me.txtContaOrigemTransferencia.Focus () end If
at any time the method that populates the tree is called. And the error points to "ddeb.DropDown ()" in AfterEnterEditMode.
That error message clearly indicates that your code is trying to add a node to the tree with a key that is a duplicate of a node that already exists.
ERROR: "An item with the same key has already been added"
AfterEnterEditMode seems like the best event to use.
What's the error?