Binding ComboBox NET6

Posted by: devcode.ou on 29 August 2023, 11:25 pm EST

    • Post Options:
    • Link

    Posted 29 August 2023, 11:25 pm EST - Updated 29 August 2023, 11:27 pm EST

    I noticed a very danger behavior in the combobox NET6 version,

    • the combobox is linked to the viewmodel (selectedvalue and itemmsource)
    • the viewmodel start with the selectedvalue already set
    • the combobox is inside a expander
    • expander start closed

    In this situation, the combobox does not show the selected value,

    because when the user open the expander the combobox “reset” the

    selected value (i think because its visible for the first time)

    If the expander starts open it works correctly.

    This is a huge problem for me (also danger) because i migrated all application from dotnet 4 version and now inside the application i have to go to find every

    similar situation and change the c1combobox with the standard wpf.

  • Posted 30 August 2023, 10:43 pm EST

    Hi,

    Apologize for any inconvenience.

    We tried to replicate this issue at our end. But failed to replicate.

    ComboBox under C1Expander working without any issues and the SelectedValue doesn’t reset after expanding/collapsing the C1Expander.

    Please refer the attached sample for the same: ComboBoxDemo.zip

    Could you please provide a small stripped sample replicating this behavior? So, we can investigate and assist you accordingly. You can also update the attached sample.

    Best Regards,

    Nitin

  • Posted 31 August 2023, 8:40 am EST

    Hi,

    i tried to replicate my case, but its not so easy to extrapolate the code, I haven’t been able to do, but using your code I made some changes and i got the same problem.

    Basically in this case the the visibility is not the cause of the problem, instead the problem occurs when the itemsource is updated (if true this problem is even more serious)

    At the moment i dont know if the problem that i noticed in my code is a consequence of this same behavior but it seems to me possible.

    In any case i attached your example with some modification,

    i used 2 combobox (c1 e wpf)

    when the viewmodel is created > init1 is executed

    when the window is loaded > init2 is executed

    you can use also the buttons, as you can see the wpf combobox shows the correct selected value.

    I will try again to replicate the situation in my code, that is little bit different but i think the problem can be the same.

    Thank you

    ComboBoxDemo.zip

  • Posted 31 August 2023, 10:55 pm EST

    Hi,

    Thanks for updating the sample. We are able to replicate this issue at our end even without C1Expander.

    This issue seems like a bug. So, we have escalated to the development team. Will get back to you once we have any update from them.[Internal Tracking Id - C1XAML-34945]

    Regards,

    Nitin

  • Posted 2 November 2023, 4:46 pm EST

    Hi,

    This issue is fixed.

    Try with the latest C1.WPF.Input 6.0.20232.624

    If still issue persists, you can get back to us.

    Best Regards,

    Nitin

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels