Thanks Kevin. I can *almost* see how to do it. But please give me a little
more help. I'm trying to generalize the following code:
this.categoryCombobox.DataSource = new DictionaryEntry[]
{
new DictionaryEntry(ContactCategories.Commissionaire,
ContactCategories.Commissionaire.ToString()),
new DictionaryEntry(ContactCategories.Contract,
ContactCategories.Contract.ToString()),
new DictionaryEntry(ContactCategories.Finance,
ContactCategories.Finance.ToString()),
new DictionaryEntry(ContactCategories.Marketing,
ContactCategories.Marketing.ToString()),
new DictionaryEntry(ContactCategories.Ops, ContactCategories.Ops.ToString()),
new DictionaryEntry(ContactCategories.Other,
ContactCategories.Other.ToString())
};
I know how to iterate through the enum and get the Key/Value pairs, but how
to plug this into the DictionaryEntry object?
Nina
"Kevin Yu [MSFT]" wrote:
Hi Nina,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to convert each object in the
array to an DictionaryEntry. If there is any misunderstanding, please feel
free to let me know.
As far as I know, there isn't a way to do this directly. We have to go
through each object and create a new DictionaryEntry object according to
the key and value. Here's an example:
DictionaryEntry de = new DictionaryEntry(object key, object value);
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."