Hi,
I am using 2-3 UltraComboEditor and setting their datasource & binding it as follows
Me.ucVerDownAspectRatio.DataSource = Me.aspectRatioDBProvider.SelectAllAspectRatios() ' this returns a List Me.ucVerDownAspectRatio.DisplayMember = "AspectRatioName" Me.ucVerDownAspectRatio.ValueMember = "AspectRatioCde" Me.ucVerDownAspectRatio.Value = 0
Me.ucVerUpconvertAspectRatio.DataSource = Me.aspectRatioDBProvider.SelectUpconvertAspectRatios() ' this returns a List Me.ucVerUpconvertAspectRatio.DisplayMember = "AspectRatioName" Me.ucVerUpconvertAspectRatio.ValueMember = "AspectRatioCde" Me.ucVerUpconvertAspectRatio.Value = 0
Both the above combo has the values : <Undefined>,4*16,6*9
Me.ucVerDownAspectRatio.DataBindings.Add("SelectedIndex", oVersion, "down_convert_aspect_ratio_cde", True, DataSourceUpdateMode.OnPropertyChanged, 0)
Me.ucVerUpconvertAspectRatio.DataBindings.Add("SelectedIndex", oVersion, "up_convert_aspect_ratio_cde", True, DataSourceUpdateMode.OnPropertyChanged, 0)
When ever the user selects <Undefined>, it hangs the application and have to exit it...
I tried to debug the same using few events(SelectionChange, AfterCloseUP...) of the combos, but it never hits the event
What can be the issue? as my other combos with same settings are working correctly.
Thanks,
Chitra
Hi Dimitar,
Thanks a lot for your reply & explanation.
It works correctly by omitting the last parameter :)
Hi Chitra,
Thank you for posting in our forums.
I believe that the issue here is that the ValueMember (“AspectRatioCde”) is a non-nullable type (for example an integer). When you databind the combos, you are specifying the nullValue parameter to be 0. If that value coincides with the “<Unknown>” aspect ratio, then when the user selects this value, the UltraComboEditor tries to assign a null value to the ValueMember. Since the ValueMember isn’t nullable it is possible that your application hangs. If this is the case what I would suggest is to omit the last parameter from the databinding code, and leave it like this:
Me.ucVerDownAspectRatio.DataBindings.Add("SelectedIndex", oVersion, "down_convert_aspect_ratio_cde", True, DataSourceUpdateMode.OnPropertyChanged)
Me.ucVerUpconvertAspectRatio.DataBindings.Add("SelectedIndex", oVersion, "up_convert_aspect_ratio_cde", True, DataSourceUpdateMode.OnPropertyChanged)
This way when the user selects “<Unknown>”, the value of the AspectRatioCde property will simply become zero and it will work properly.
Let me know if you have any additional questions.