Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1735
Application hangs after selecting certain data in UltraComboEditor
posted

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

  • 23930
    Offline posted

    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.