I have a bound combo to a SQL Server tinyint field and a list of items to chose from populated by setting the databindings to a dataview with a tinyint value field and string display field.
Selecting an item in the list is firing the ItemNotInList event though. Very weird: in the event, capturing the value field shows the correct new value and after the event , the focus changes and the dataset isupdated with the correct value. If I select the previously chosed value (that is, the value of the bound record), then the event does not fire.
If indeed I do type an invalid value, the event shows the bad text as the value, the old value is restored, and the dataset is not updated.
Hi,
The combo does not know anything about the back end, it only knows about the DataType of the field you are binding to. So if both the column on the list and the values you are binding to are the same type, it should work.
Just to be sure, I tested this out using Integer (which I am sure work, since this is what most people use for the ValueMember) and then I tested it with Byte, just in case Byte behaves oddly for some reason. They both work perfectly fine for me and the ItemNotInList event never fires when I pick an item from the list.
I also tested this using both UltraCombo and UltraComboEditor and they both work the same.
I'm attaching my sample here so you can see if it gives you the same results.
Okay, sorry, I assumed it was a grid.
But anyway, this should work fine as long as you are sure that the Value of the control is being set to a Byte and also the DataValues of the items on the list are also Bytes.
I know that this works with other data types, so there's no reason why Bytes should be any different.
sunibla said:Version 2110.2
Ummm... there is no such version. I assume this is a typo and you mean 2010.2?