/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do not process } else { // Build the format StringBuilder sb = new StringBuilder(); bool isRadioButtonList = ControlType.EqualsCSafe("radiobutton", true); if (isRadioButtonList) { sb.Append("<input type=\"radio\" value=\"{3}\""); } else { sb.Append("<input type=\"checkbox\" class=\"", this.ShortClientID, "_check\""); } if (IsDesign) { if (isRadioButtonList) { sb.Append(" name=\"", this.ShortClientID, "_radio\" onmousedown=\"RadioListClick(this, '", this.ShortClientID, "', 'SelectedItem'); return false;\""); } else { sb.Append(" onmousedown=\"CheckListClick(this, '", this.ShortClientID, "', 'SelectedItems'); return false;\" value=\"{3}\""); } } else { sb.Append(PortalHelper.GetDisabledFormElementAttributes()); } sb.Append(" {1} /> {0}"); if (Horizontal) { sb.Append(" "); } else { sb.Append("<br />"); } ltlText.ItemFormat = sb.ToString(); ltlText.Text = Items; ltlText.SelectedItems = SelectedItems; ltlText.SelectedItemText = " checked=\"checked\""; } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do not process } else { // Build the checkbox StringBuilder sb = new StringBuilder(); bool isRadioButton = ControlType.EqualsCSafe("radiobutton", true); if (isRadioButton) { sb.Append("<input type=\"radio\""); } else { sb.Append("<input type=\"checkbox\""); } if (IsDesign) { if (isRadioButton) { sb.Append(" onmousedown=\"this.newChecked = this.checked = !this.checked; SetWebPartProperty('", this.ShortClientID, "', 'Checked', this.checked + ''); return false;\" onchange=\"this.checked = this.newChecked;\""); } else { sb.Append(" onmousedown=\"SetWebPartProperty('", this.ShortClientID, "', 'Checked', (this.checked = !this.checked) + ''); return false;\""); } } else { sb.Append(PortalHelper.GetDisabledFormElementAttributes()); } if (Checked) { sb.Append(" checked=\"checked\""); } sb.Append(" />"); ltlChk.Text = sb.ToString(); ltlText.Text = Text; } }
/// <summary> /// Initializes the control properties. /// </summary> protected void SetupControl() { if (StopProcessing) { // Do not process } else { ltlText.Text = GetWireframeText(Text, false); ltlText.Style += String.Format("background-color: {0}", Color); colElem.Color = Color; colElem.TargetElementID = ltlText.ClientID; // Note mark if (ControlType.EqualsCSafe("notemark", true)) { ltlMark.Visible = false; resElem.Visible = false; } // Note else { ltlMark.Text = MarkText; // Height string h = WebPartHeight; if (!String.IsNullOrEmpty(h)) { ltlText.Style += String.Format("height: {0};", h); } // Width string w = WebPartWidth; if (!String.IsNullOrEmpty(w)) { ltlText.Style += String.Format("width: {0};", w); } resElem.ResizedElementID = ltlText.ClientID; } } }