Adf.Web.UI.DropDownListItem.Create C# (CSharp) Method

Create() public static method

Create a System.Web.UI.WebControls.DropDownList and add it into Adf.Web.UI.BasePanelItem.
public static Create ( string label, string name, int width, bool enabled = true ) : DropDownListItem
label string The display text of the drop-down list within .
name string Set the identification of control.
width int Width of control.
enabled bool A value indicating whether the control is enabled or not.
return DropDownListItem
        public static DropDownListItem Create(string label, string name, int width, bool enabled = true)
        {
            var l = new Label {Text = ResourceManager.GetString(label)};

            var dropDownList = new DropDownList
                                   {
                                       ID = Prefix + name,
                                       Enabled = enabled,
                                       Width = new Unit(width, UnitType.Ex)
                                   };

            dropDownList.PreRender += delegate { dropDownList.CssClass = (dropDownList.Enabled) ? ("DropDownList") : ("DropDownList ReadOnly"); };

            return new DropDownListItem(l, dropDownList);
        }