You can create a dropdown list as a custom property in Visual WebPart by defining your list as an enumeration as shown below
public enum customProperyList { Select,List1, List2, List3 }; public customProperyList _list; [WebBrowsable(true), WebDisplayName("My List"), WebDescription("Select from your list"), Personalizable(PersonalizationScope.Shared), System.ComponentModel.Category("Mail Settings"), DefaultValue("Select") ] public customProperyList _List { get { return _list; } set { _list = value; } }
Output
See also, How to create a Custom Property in Visual WebPart?
1k questions
670 answers
451 comments
193k users
Related Activities
Categories
Most popular tags