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_RadioButtonList: 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 item /// public string SelectedItem { get { return ValidationHelper.GetString(this.GetValue("SelectedItem"), ""); } set { this.SetValue("SelectedItem", 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.SelectedItems = SelectedItem; ltlText.SelectedItemText = " checked=\"checked\""; ltlText.Text = Items; } } /// /// Reloads the control data. /// public override void ReloadData() { base.ReloadData(); SetupControl(); } }