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.
Well, just as a test, try just binding one of them and see if that's what is causing the problem.
If not, then the only other explanation I can think of is that your data source is rejecting the change - either because the field is read-only or else there is some kind of validation occurring. What's the DataType of the Value field in your data source? What's the DataType of your ValueMember column in your UltraCombo?
i just tried binding with single property(tried with both text & value alternatively), its working fine.
when we bind the UltraCombo data source with NULL or nothing (default) only I'm getting this two property bound issue.
string is the data type in both data source & control.
still it is working fine with 7.1 version.
I'm not exactly sure what you mean when you say "when we bind the UltraCombo data source with NULL". Are you talking about not setting the DataSource at all? Or binding to a field with null in it?
DataSource has nothing do with the DataBindings for the Value or Text, DataSource is for the list portion of the control.
It still seems like a vary odd thing to do binding to two different fields with both Value and Text like this. Typically, you would just save the ID and then use a lookup table to get the text rather than storing the text separately on every row. That's a tremendous waste of space.
Anyway, it seems like your scenario is too complex and there are too many unknowns for me to duplicate the problem on my own. Can you post a small sample project here that demonstrates the issue so I can check it out?
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.
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.