Searching Combo List

Posted by: GetInfo on 16 January 2024, 8:08 am EST

    • Post Options:
    • Link

    Posted 16 January 2024, 8:08 am EST

    I have a combo in the WindForms version, populated from a table with 2 columns, one the primary key and the other description. I want to show only the description in the list so I have made the PK column as the second column and made it hidden.

    When the user makes a selection I need to access the PK.

    I can get the description and search the list, but is there an alternative approach? Can I get the PK from the display in the combo?

    Thanks

  • Posted 16 January 2024, 8:06 pm EST

    Hi,

    In your scenario, the best approach to get the PK for the selected description in C1Combo is to define the ValueMember and DisplayMember properties. Then, whenever an item is selected from the dropdown, you can use the SelectedValue property to determine the PK of the selected item.

    Please see the attached sample project for reference - C1ComboGetSelectedItem.zip

    Best Regards,

    Kartik

  • Posted 18 January 2024, 2:20 am EST

    Thanks, that perfect

Need extra support?

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

Learn More

Forum Channels