none
DataGridViewComboBoxColumn selects first value automatically when duplicate values are available RRS feed

  • Question

  • Hi,

    I am having a problem with DataGridView in windows application C#.

    I have added a DataGridViewComboBoxColumn in my DataGridView and I am binding it with a datatable. I am assigning the value member a primary key field and a string field to the display member. When I am selecting the values from the combobox column, and if there are duplicate values in the display member field, it automatically selects the first value, even if both have different value member.

    For example following values are there in the combobox column, and when I am selecting the value 'hardik' it is being selected correctly. But when I am selecting the value 'HARDIK', the first value 'hardik' is automatically selected when I am pressing tab.

    and when I am pressing tab, it automatically selects the first value 'hardik'....

    I am not finding any solution for this. Though, the value member is a primary key and both the names are having different values associated, it does not select the duplicate value in the display member.

    Please help,

    Thanks,

    Amit Shahani

    Thursday, July 26, 2012 10:00 AM

All replies

  • Hi,

      This very same issue occurs for me with DataGridViewComboBox column and is this still an issue for anyone or were able to resolve it?

    Regards,

    Sudharshan.

    Wednesday, June 5, 2019 12:05 AM