C1ComboBox crashed after selecting the 1st item

Posted by: t.koss on 4 January 2025, 3:08 am EST

  • Posted 4 January 2025, 3:08 am EST

    i updated my project to winforms for .net 8 in visual basic

    Now there is a cash by selecting the 1st item in a combobox

    
    ' select start Portfolio
    If C1ComBox_Depot.Items.Count > 0 Then
        C1ComBox_Depot.SelectedIndex = 0
    End If

    with winforms 4.5.2 all was working fine

    The error description is as follows:

    System.InvalidCastException: “Overload resolution failed because no Public ‘<>’ can be called with these arguments:

    ‘Public Shared Operator <>(a As String, b As String) As Boolean’:

    Argument matching parameter ‘b’ cannot convert from ‘ComboBoxItem’ to ‘String’.”

  • Posted 6 January 2025, 2:10 am EST

    Hi,

    We tested the issue you mentioned using the latest 2024v2 (693) version of C1ComboBox but were unable to reproduce the issue. Please refer to the attached sample project for reference.

    It appears that the issue might be specific to your implementation of C1ComboBox. Therefore, we kindly request you to modify the attached sample project to replicate the issue, so we can investigate further and provide better assistance.

    Attachment: ComboBoxTest.zip

    Best Regards,

    Kartik

  • Posted 7 January 2025, 3:31 pm EST

    Somehow i can’t reproduce the issue, by deleting an adding a new ComBobox it was gone.

    I guess there was a problem with the previous code, because i was assigning a treeview node item of kind object to a Combobox item.

    ' Fill Combobox with depot names
    For Each a In C1TreeView_Main.Nodes
        C1ComBox_Depot.Items.Add(a.Item(0))
    Next
    
    ' select start Portfolio
    If C1ComBox_Depot.Items.Count > 0 Then
        C1ComBox_Depot.SelectedIndex = 0
    End If

    Maybe it’s saver to add a string conversation to the object

    C1ComBox_Depot.Items.Add(a.Item(0).ToString)

    Your example code was also working fine, but i can’t add some treeview controls to it for further tests. I only have access to winforms 2024v2 (688) instead of 2024v2 (693) and the packages conflocting each other.

    Best regards,

    Thomas

  • Posted 8 January 2025, 1:26 am EST

    Hi Thomas,

    Thanks for the update. It seems like you were able to resolve the issue on your end. We will close this case for now. In case you face a similar issue in the future, please don’t hesitate to reopen this thread by replying to it.

    Best Regards,

    Kartik

Need extra support?

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

Learn More

Forum Channels