Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
255
Losing focus when dropdown in UltraTextEditor
posted

I have an UltraTextEditor with a DropDownEditorButton. That button drops down a usercontrol with a tree and some more things.

I want the following feature: When the user type a text, the control should be dropped down (if is not dropped) and the tree data should be filtered by that text. The problem comes when i drop down, because UltraTextEditor seems like lose the focus on the text. This is some of the code:

 

private void txtConcepto_KeyDown(object sender, KeyEventArgs e)

        {

                // This is used to filter the data on my usercontrol.

                this.ctrArbolConceptos.FiltrarConceptos(this.txtConcepto.Text);

                // The controls drop down, and i lose the focus on my text.

                if (!((DropDownEditorButton)this.txtConcepto.ButtonsRight["ddbConcepto"]).IsDroppedDown)

                    ((DropDownEditorButton)this.txtConcepto.ButtonsRight["ddbConcepto"]).DropDown();

 

                // If i try to manually set the focus, the dropdown is closed...

                this.txtConcepto.Focus();

        }