Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fluxdigital/91adcc1cdee678de66c81c4e2784e400 to your computer and use it in GitHub Desktop.
Save fluxdigital/91adcc1cdee678de66c81c4e2784e400 to your computer and use it in GitHub Desktop.
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