In my project, I have INGRAGISTICS 11.1 version. I’m getting the issue in UltraCombo control. Unable to tab out from control.
When we try to find the cause, we observed that OnValidating is failing (always e.cancel = true is returning).
I have XML entity data binding, in my form.
Binding sample code:
this.cmbListC.DataBindings.Add("Value", xKey, "InnerXml");
this.cmbListC.DataBindings.Add("Text", xValue, "InnerXml");
Why always e.cancel is retuning true when data source is null.
Are you binding both the Value and Text properties of the control to different fields? That doesn't make sense and it might be the cause of the problem.
The Value and the Text are linked together. In fact, they are always the same value in the UltraTextEditor and are not stored separately. So unless your "xValue" and "xKey" values are always exactly the same, this will cause a problem. Even if they are not the same, editing the UltraTextEditor will end up trying to update both fields to the same value, which makes the value redundant at the very least and potentially dangerous at worst.
Try binding either the Value or the Text and not both and see if that helps. If not, and you still see the problem when bound to only one field, then my guess is that your data source is not updateable or cannot accept the current value of the UltraTextEditor for some reason.
Mike, we are binding both Text & Value properties of the control to the different fields. and important one is, the control, its not UltraTextEditor its UltraCombo.
i want to bind both text & value, because i want to update both in database.
If this grid/band contained parent's children, then I can see how the combo would have Id for table key (FK) and Text for description. Maybe the combo holds Parts for OrderLines for an Order?
Hi Lars,
I'm sorry, but I do not understand what you are asking.
Typically, the Combo is used to choose a value in a table. For example, suppose you have a table of addresses. Each address has a field for State. But storing the entire name of the state in each address would be inefficient. So you would probably use some ID for each state - maybe a numeric ID, or the state abbreviation.
So your states table might look like this:
Id Name Abbreviation
1 Alabama AL2 Alaska AK3 Arizona AZ4 Arkansas AR5 California CA6 Colorado CO...46 Virginia VA47 Washington WA48 West Virginia WV49 Wisconsin WI50 Wyoming WY
Your UltraCombo's DataSource would point to the table. Your ValueMember would probably be the Key (or possibly the Abbreviation) and your DisplayMember would be the Name. This would display the user-friendly name of the state while storing the Id/Abbreviation in the Combo's Value.
Your address field would probably have either the key or the Abbreviation. But it doesn't make sense for the Address to contain both the key and the Name, since the Name can be retrieved via the key at any time. Storing both could lead to data corruption. For example, if you changed the name of a state for some reason - you would have to update the entire Address table every time that name appeared instead of just in one place.
So I don't really understand why you would want to bind two fields from the same control to on table when those two fields are inextricably linked like Value and Text in the combo.
If I am wrong, and there is some reason why you need this, then I will need to see a small sample project demonstrating the problem in order to be able to assist you, because I can't guess why it's not working without seeing it and debugging it.
I would have a hidden column called StateId and a visible column called State. The State column has the ValueList you described attached to it.
When the user selects a ValueListItem from the combo, I must copy the Value to the StateId hidden column's Value so the database will be updated properly. The State is not stored in the database, just the StateId.
I use the grid's AfterCellListCloseUp event to do this, but I think it fires only with mouse usage, not keyboard input.
A better way to do it would be to remove the State column entirely, since it is redundant. Then you attach the combo to the StateID column. Set the combo's ValueMember to the StateId and it's DisplayMember to the State and the combo will handle translating the ID to the State so the user sees the names and the ID's are saved (by binding the Value of the control).
That's the way it's usually done.
In theory, your way might work - especially if it used to work. But again, in order to figure out why it's not working, I'd need to be able to debug a working sample.
Milk, i have attached the sample project with two UltraCombo controls & one UltraTextEditor. navigation from first combo to second combo is fine but from second combo to text box giving issue. i want solution for this.
Durga,
Only set it to false when there isn't a value. Perform a if check and when the combo is provided a value the value changed event will fire. There you can enable Validation and continue as planned. You won't need validation when there isn't a value right?
Michael, setting the property CausesValidation to 'false' will skip the control Validating & Validated events.
but in this events i have some logic. now it is not invoking. so what is the solution for this.
Hello Durga,
I have a strong feeling that in 7.1 there were issues with validating. The reason I bring this up is because the control is designed to validate when you try to leave focus. Because there isn't a value it won't let you leave focus until you do something. Normally if a control is empty it should be read-only so the end user cannot enter edit mode and to specifically avoid these types of situations. I strongly recommend not having the combo present or be interacted with if it's empty.
You can toggle off the validation with the CausesValidation property set to false to address this behavior.
cmbListB.CausesValidation = false;
Let me know if you have any questions regarding this matter.
Hi Michael, if i change DropDownStyle to DropDown it's working fine but with this default style, control allowing user to enter text but my requirement is no not to allow any text.
The issue seems to be related to setting the DropDownStyle to DropDownList. I changed it back to it's default and I was able to tab through the controls. The editor is filled with "(none)" though. I'm still investigating this.