I have a custom object that inherits from NameObjectCollectionBase. In my derived class I have a method "GetValueKeyPairs" that returns a string array of the pairs (ex. "Value - Key"). I am trying to bind this to the display member of a combobox and want the value member to be the GetAllValues() method in the NameObjectCollectionBase.
I can set the display of the items to the GetValueKeyPairs by:
But I can't seem to set the ValueMember of the combobox to be the GetAllValues.VB Code:
cboData.DataSource() = x.GetValueKeyPairs()
Any ideas on how I can accomplish this?


Reply With Quote