DropDownList

This attribute is a MetadataAttribute.
It's an metadataattribute which will help to to specify for a property the corresponding property to use to display a dropdownlist control.

public class Address
{
    public string Street { get; set; }

    public List<string> CityList { get; set; }

    [DropDownList("CityList")]
    public string City { get; set; }
}

For most common case, it's not very usefull to use this attribute except that it will be easier to understand the model.
But, if you want to create a custom editor, it could be very helpfull.

Last edited Jun 12, 2013 at 11:34 AM by jefflequeux, version 1

Comments

No comments yet.