public RsRadioButtonTemplateField(Control parent) { container = new TemplateOwner(); header = new RsRadioButtonListTemplate(parent, ListItemType.Header); header.InstantiateIn(container); this.HeaderTemplate = header; this.HeaderStyle.VerticalAlign = VerticalAlign.Middle; this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; item = new RsRadioButtonListTemplate(parent, ListItemType.Item); item.InstantiateIn(container); this.ItemTemplate = item; }
private void AddControl(string id, Control container) { Literal c = new Literal(); string groupName = GroupName(parent); id = UWeb.GetUniqueName(parent, "ctl" + rowIndex + id); c.Text = "<input type='radio' id='" + id + "' name='" + groupName + "' value='" + rowIndex + "'"; if (RsRadioButtonListTemplate.SelectedIndex(parent) == rowIndex) { c.Text += " checked='checked'"; } c.Text += "/>"; container.Controls.Add(c); rowIndex++; }