public DynamicRadioButtonList() { controlXML = new DynamicRadioButtonListXml(); _tbControls = new Table(); _trControls = new TableRow(); _tdLabel = new TableCell(); _tdControl = new TableCell(); _tdRequired = new TableCell(); _trControls.Cells.Add(_tdLabel); _trControls.Cells.Add(_tdControl); _trControls.Cells.Add(_tdRequired); _tbControls.Rows.Add(_trControls); _radioButtonList = new RadioButtonList(); _radioButtonList.CausesValidation = false; _radioButtonList.RepeatDirection = RepeatDirection.Horizontal; _required = new RequiredFieldValidator(); _required.Display = ValidatorDisplay.Dynamic; _required.EnableClientScript = true; _required.Text = "*"; _required.Enabled = false; _tdControl.Controls.Add(_radioButtonList); _tdRequired.Controls.Add(_required); this.Controls.Add(_tbControls); }
public DynamicRadioButtonList(DynamicRadioButtonListXml xml) { _tbControls = new Table(); _trControls = new TableRow(); _tdLabel = new TableCell(); _tdControl = new TableCell(); _tdRequired = new TableCell(); _trControls.Cells.Add(_tdLabel); _trControls.Cells.Add(_tdControl); _trControls.Cells.Add(_tdRequired); _tbControls.Rows.Add(_trControls); _radioButtonList = new RadioButtonList(); _radioButtonList.CausesValidation = false; _radioButtonList.RepeatDirection = RepeatDirection.Horizontal; _required = new RequiredFieldValidator(); _required.Display = ValidatorDisplay.Dynamic; _required.EnableClientScript = true; _required.Text = "*"; _required.Enabled = false; _tdControl.Controls.Add(_radioButtonList); _tdRequired.Controls.Add(_required); this.Controls.Add(_tbControls); this.ID = xml.Name; this.IsRequired = xml.IsRequired; this.ErrorMessage = xml.ErrorMessage; this.ValidationGroup = xml.ValidationGroup; this.ErrorMessage = xml.ErrorMessage; this.ValidationGroup = xml.ValidationGroup; this.controlXML = xml; this.Visible = xml.Visible; }