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
1330
Can't leave UltraComboEditor field when DataBinding is set
posted

I have recently started using the UltraComboEditor and have noticed an un-desirable 'bug' of the control.

I initialize the control in the designer as follows:

this.uceDepartmentHeadName.DataBindings.Add(new System.Windows.Forms.Binding("Text", this.bdsTop, "DepartmentHeadName", true));

this.uceDepartmentHeadName.DataBindings.Add(new System.Windows.Forms.Binding("Value", this.bdsTop, "DepartmentHeadID", true));

 

this.uceDepartmentHeadName.DataMember = "ttwDepartmentHead";

this.uceDepartmentHeadName.DataSource = this.pdsFillLists;

this.uceDepartmentHeadName.DisplayMember = "DepartmentHeadName";

this.uceDepartmentHeadName.ValueMember = "DepartmentHeadID";

 

When I run the program and proceed to change the text of the control by typing something that is NOT in the itemList of the control, the control will NOT give up focus.  That is, if I try to click to another control the UltraComboEditor will still have the focus.  The only way to reliquinish the focus to another control is to select an item from the UCE's list.

If I remove ONE of the two bindings from the control I do not get this behaviour... Is this a bug?  If not, why is it behaving this way and how can I alter this behaviour?

Parents
No Data
Reply
  • 469350
    Suggested Answer
    Offline posted

    I'm not sure if this is the problem, but the code you have here doesn't make much sense. The Text and the Value of a combo are dependent on each other, and binding them both at the same time is a contradiction. You should probably only be binding the Value and not the text.

    What's probably happening here is that when you change the text in the control, it's trying to write both changes back to the data source and one of them is being rejected.

Children