StrataFrame Forum

ComboBox, using AutoSelectFirstItemOnValidateForNoSelection, errors after second invalid entry

http://forum.strataframe.net/Topic32463.aspx

By Govinda Berrio - 2/24/2014

Hello SF Devs, 

Can you confirm this bug that I am experiencing? 

I have an SF ComboBox bound to a business object integer property. It is setup to be an AutoComplete ComboBox (Mode: SuggestAppend) and the AutoSelectFirstItemOnValidateForNoSelection is set to true. 
It works fine until the user types a string that does not match any option in the dropdown and tabs off the control twice in a row.
At this point it will throw the following error: 

Specified cast is not valid.
   at GKGLibExamples.BusinessObjects.ItemsBO.FieldDescriptor.SetValue(Object component, Object value) in C:\Users\gberrio\Documents\Visual Studio 2008\Projects\GKGLib\GKGLibExamples\BusinessObjects\ItemsBO.Designer.cs:line 1767
   at System.Windows.Forms.BindToObject.SetValue(Object value)
   at System.Windows.Forms.Binding.PullData(Boolean reformat, Boolean force)

The value it is trying to set the property to is DBNull.

Reproduction Steps:
    - select the combobox
    - enter a string that does not return an auto suggest option
    - tab off the control
    - select the combobox again
    - enter a string that does not return an auto suggest option
    - ! ERROR !

http://forum.strataframe.net/Uploads/Images/c7e7d89c-a85c-4544-81e7-ca06.PNG