I have a dropdown control placed on a winform. Today the datasource for this dropdown is KeyValuePair<'string','string'> and hence it is easy to directly assign the 'DisplayMember' property of the dropdown to 'Value' from the KeyValuePair.
One of my requirements has caused this datasource to be changed to KeyValuePair<'string', KeyValuePair<'string','string'>. This poses problems for me when I run my code. Thats because 'DisplayMember' being set to 'Value' causes the dropdown item to be shown as ('AB') (where 'A' and 'B' are the respective strings in KeyValuePair<'string','string'> of the new datasource).
I want to assign the 'DisplayMember' property of the dropdown to the 'Key' in the KeyValuePair<'string','string'> from the changed datasource.
Old requirement -
KeyValuePair<'string','string'>('A','B')
Dropdown item shows - 'B'
New requirement -
KeyValuePair<'string',KeyValuePair<'string','string'>('A', new KeyValuePair<'B','C'>)
Dropdown item should show - 'B'
Is it possible to do implement with only change in dropdowns properties?
Have checked the datasource but it only shows me the top level of Key-Value pair and not the hierarchical model.