Condividi tramite


IDynamicValues Interface

Definition

The IDynamicValues interface is used to create dynamic lists for string properties. A class should implement this interface, and use the DynamicValuesAttribute (below), to enable the generation of dynamic values.

This interace and attribute can be used when a list of strings that will not be known until run-time should be shown in a drop down list. Good examples of this are database names, users, collations, etc.

public interface IDynamicValues
type IDynamicValues = interface
Public Interface IDynamicValues

Examples

public TypeConverter.StandardValuesCollection GetStandardValues(ITypeDescriptorContext context) { string[] collationName = new string[] { "first item", "second itme" }; return new TypeConverter.StandardValuesCollection(collationName); }

Methods

GetStandardValues(ITypeDescriptorContext)

GetStandardValues should return a StandardValuesCollection which contains all the items to be displayed in the list of the property specifiec in context.

Applies to