using System; using System.Data; using System.Collections; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; using System.Web.UI.HtmlControls; using System.Text; using CMS.ExtendedControls; using CMS.GlobalHelper; using CMS.PortalControls; public partial class CMSWebParts_Wireframe_Forms_CheckBoxList : CMSAbstractWebPart { #region "Properties" /// /// Items /// public string Items { get { return ValidationHelper.GetString(this.GetValue("Items"), "Item 1\nItem 2\nItem 3"); } set { this.SetValue("Items", value); } } /// /// Selected items /// public string SelectedItems { get { return ValidationHelper.GetString(this.GetValue("SelectedItems"), ""); } set { this.SetValue("SelectedItems", value); } } /// /// Horizontal /// public bool Horizontal { get { return ValidationHelper.GetBoolean(this.GetValue("Horizontal"), false); } set { this.SetValue("Horizontal", value); } } #endregion /// /// Content loaded event handler. /// public override void OnContentLoaded() { base.OnContentLoaded(); SetupControl(); } /// /// Initializes the control properties. /// protected void SetupControl() { if (StopProcessing) { // Do not process } else { // Build the format StringBuilder sb = new StringBuilder(); sb.Append(" {0}"); if (Horizontal) { sb.Append(" "); } else { sb.Append("
"); } ltlText.ItemFormat = sb.ToString(); ltlText.Text = Items; ltlText.SelectedItems = SelectedItems; ltlText.SelectedItemText = " checked=\"checked\""; } } /// /// Reloads the control data. /// public override void ReloadData() { base.ReloadData(); SetupControl(); } }