Hello,
I hope this is the right forum, because my problem affects UltraCombo / UltraComboEditor as well.
We were able to adjust the settings for a standalone UltraCombo / UltraComboEditor, so that the user can search items by typing (DropDownStyle = DropDown, AutoCompleteMode = SuggestAppend) and get's a hint (by UltraValidator), when the typed text is not in the list.
Now we'd like to achieve the very same when the UltraComboEditor is placed as an EditorComponent on a GridCell. What we want is, that the user can type characters and get's suggestions (like AutoCompleteMode = SuggestAppend) and a hint is displayed in the cell, when no matching item for the entered text could be found.
We did a lot of searching and trying but didn't succeed. We observed, that when entering text which could not be found in the list, it's lasting much longer until the component recognizes, that no matching item could be found, when the UltraCombo is in a GridCell compared to a standalone UltraComboEditor.
What the heck is the UltraGrid doing meanwhile? Could you be so kind as to explain the matching-process in the grid-case? What is the appropriate way to achieve our desired solution?
We are using Infragistics v10.3 and the data for the lookup is delivered by a catalogue table (primkey as ValueMember and name as DisplayMember) and the value to be edited is a foreign-key in another table (e.g. fk_catalogue)).
Hope you can help us once more and thanks in advance,
Roman
Hello Roman,
Maybe one possible way to achieve the desired behavior could be if you are using UltraControlContainerEditor. I try to reproduce your scenario using a UltraComboEditor with Validator and UltraGrid. Please take a look at the attached sample for more details and let me know if you have any questions.
Regards
Have you been able to resolve your issue ? Did you have a time to take a look at the attached sample. Let me know if you have any questions.
Hello Georgi,
I have one more question regarding the attached example. In our application the DropDown column is always an integer datatype. So I changed the datatype of column "B" in your example to int and accordingly the data type of the ValueListItems from the UltraComboEditor and then typed some invalid value that is not in list. After cell exit an exception is thrown with the text:
Unable to update the data value: Value could not be converted to System.Int32
If I do the same on stand alone UltraComboEditor no exception will be thrown.
It is possible to enforce the same behavior (no exception) in UltraGrid?
Thank you very much.
I suppose that you change also the DataType of property DataValue of all items in your ValueListItem. Also you should change the dataType in ValidationSettings and Condition. Please take a look at the attached video file for more details.
Because the dataType of our UltraGird`s column "B" is integer (also the same is in our DataSet), it means that we should provide to that column only integer values.
Meanwhile we are able to enter via UltraComboEditor new string item in the Coumn B, so we get mentioned exception. We have two or three possible options:
Option 1: - We could set property "RetainFocusOnError = True" . Please take a look at the attached smaple, where is used this approach
Option 2: - Set property "DropDownStyle = DropDownList" - by this way the user could select only exsisting items
Option 3: - We could handel Validating event of our UltraValidator and include our custom code to process such kind scenario.
Please let me know if you have any questions
thank you very much for the example!
The solution with DropDownStyle Property = DropDownList seems the best one for us. The only problem in doing so is that the user cannot type a complex searching string in the grid cell. The DropDown repositions its value on every key typed. In other words, if the user wants to find the item with the text "find me" and types " f " and then types " i " the value of DropDown will be positioned to the first item beginning with i.
Is it possible to allow the user to type " fi "?
Thank you very much
GEDAT said:Is it possible to allow the user to type " fi "?
If you are using DropDownStyle = DropDownList, it is not possible at that moment. Maybe you should choose between both options. Please let me know if you have any questions.
What is the Style of the grid column set to? The grid shouldn't stop you from leaving the cell - unless maybe the data source is disallowing the value the grid is trying to write to that cell.
Try handling the grid's Error or CellDataError events. One or both of those should be firing in that case.
Hi,
I have a ultracombo in a ultragrid cell. This combo has ValueMember = ItemID and DisplayMember = ItemDsc. Ultra combo has been configured as a dropdown, so it's possible type the desired text.
When the user types a text that match any of the available values the dropdown suggest the value correctly.
When the user types a number (that obviously doesn't exists) and then he tabs out, the value is set to the property and my own validation is displayed correctly.
But when the user types a text that doesn't exist and then he tabs out, the value is not assigned to the property and no validations are displayed. The focus remains at the combo, is not possible to tab out and there is not validations.
Is there anything I can do for getting the validation when the user types an incorrect text?
Thanks
I'm not sure I understand what you are asking. You want the grid cell to update the data in the dropdown list? That doesn't make any sense.
Are you saying that your grid also has the same two fields that you have the in dropdown? That doesn't make a lot of sense, either, since it's redundant. But in any case, there's no way the grid can do that for you automatically.
What you would have to do is get use an event of the grid, like BeforeCellUpdate. Get the ValueList from the cell and use the GetValue method on the ValueList to try to find a matching item on the list. If the index returned is -1, then you know the item does not exist on the list and you can set the Value of the other cell in the same grid row to the Text of the cell.
I have an ultracombo in an Ultragrid with ValueMember = "ItemId" and DisplayMember = "ItemText".
If the user types a new value that doesn't exist in the ultracombo. I want it to update the itemText property in the datasource used in the ultragrid instead of the itemId. Is that possible?