45 lines
1.1 KiB
C#
45 lines
1.1 KiB
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Linq;
|
|||
|
|
using System.Web;
|
|||
|
|
using umbraco.cms.businesslogic.datatype;
|
|||
|
|
|
|||
|
|
namespace umbraco.editorControls.SettingControls
|
|||
|
|
{
|
|||
|
|
public class ListBox : DataEditorSettingType
|
|||
|
|
{
|
|||
|
|
private System.Web.UI.WebControls.ListBox lb = new System.Web.UI.WebControls.ListBox();
|
|||
|
|
|
|||
|
|
private string _val = string.Empty;
|
|||
|
|
public override string Value
|
|||
|
|
{
|
|||
|
|
get
|
|||
|
|
{
|
|||
|
|
return lb.SelectedValue;
|
|||
|
|
}
|
|||
|
|
set
|
|||
|
|
{
|
|||
|
|
if (!string.IsNullOrEmpty(value))
|
|||
|
|
_val = value;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
public override System.Web.UI.Control RenderControl(DataEditorSetting sender)
|
|||
|
|
{
|
|||
|
|
lb.ID = sender.GetName();
|
|||
|
|
|
|||
|
|
lb.CssClass = "guiInputStandardSize";
|
|||
|
|
|
|||
|
|
lb.Items.Clear();
|
|||
|
|
|
|||
|
|
foreach (string s in Prevalues)
|
|||
|
|
{
|
|||
|
|
lb.Items.Add(s);
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
lb.SelectedValue = _val;
|
|||
|
|
|
|||
|
|
return lb;
|
|||
|
|
}
|
|||
|
|
}
|
|||
|
|
}
|