Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Custom WFFM dropdown list
public class CustomDropDownList : DropList
{
private static readonly string BaseCssClassName = "scfCustomlistBorder";
[ParameterName("emptychoicetext")]
[VisualCategory("Custom")]
[VisualProperty("Empty Choice Text:")]
public string EmptyChoiceText { get; set; }
[ParameterName("showemptychoice")]
[VisualCategory("Custom")]
[VisualFieldType(typeof(BooleanField))]
[VisualProperty("Show Empty Choice:")]
public bool ShowEmptyChoice { get; set; }
[ParameterName("initialselection")]
[VisualCategory("Custom")]
[VisualProperty("Initial Selection:")]
public string InitialSelection { get; set; }
[VisualFieldType(typeof(CssClassField))]
[DefaultValue("scfCustomlistBorder")]
[VisualProperty("CSS Class:", 600)]
public new string CssClass
{
get { return base.CssClass; }
set { base.CssClass = value; }
}
//blank out inheritted properties
public new ListItemCollection Items
{
get { return this.items; }
set { this.items = value; }
}
public new string EmptyChoice
{
get { return false.ToString(); }
}
public new ListItemCollection SelectedValue
{
get { return this.selectedItems; }
set { this.selectedItems = value; }
}
protected override void InitItems(ListItemCollection items)
{
base.InitItems(items);
}
protected override void DoRender(HtmlTextWriter writer)
{
base.DoRender(writer);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.