Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

How can I supply a list of values to be chosen from a dropdown list at runtime for a specific type similar to enums?

0
Posted

How can I supply a list of values to be chosen from a dropdown list at runtime for a specific type similar to enums?

0

You have to implement a TypeConverter for your class and override the GetStandardValues and GetStandardValuesSupported method. In your override of GetStandardValuesSupported you have to return true. In your override of GetStandardValues you should return the list of values. Optionally you can override GetStandardValuesExclusive and allow the user to specify values that are not in the value list. Note: The standard values collection can be initialized at runtime depending on the context of the instance object.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123