protected override void CreateChildControls() { Controls.Clear(); ownerValue = new TemplateOwner(); ITemplate temp = templateValue; temp ??= new DefaultTemplate(); temp.InstantiateIn(ownerValue); this.Controls.Add(ownerValue); }
public RsCheckBoxTemplateField() { container = new TemplateOwner(); header = new RsCheckBoxListTemplate(ListItemType.Header); header.InstantiateIn(container); this.HeaderTemplate = header; this.HeaderStyle.VerticalAlign = VerticalAlign.Middle; this.HeaderStyle.HorizontalAlign = HorizontalAlign.Center; item = new RsCheckBoxListTemplate(ListItemType.Item); item.InstantiateIn(container); this.ItemTemplate = item; }
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; }
protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding) { DataRow[] rows = LabelFormatData.Select("name='" + _labelFormat + "'"); if (rows.Length == 0) { throw new InvalidOperationException("LabelFormat is invalid!"); } DataRow row = rows[0]; // // page setup // Style.Add("Text-Align", "center"); Style.Add("padding", row["PageTopMargin"] + "mm " + row["PageRightMargin"] + "mm " + row["PageBottomMargin"] + "mm " + row["PageLeftMargin"] + "mm"); Style.Add("width", row["PageWidth"] + "mm"); Style.Add("height", row["PageHeight"] + "mm"); Controls.Clear(); ITemplate temp = templateValue ?? new DefaultTemplate(); int count = 0; foreach (object o in dataSource) { ownerValue = new TemplateOwner(o, count); ownerValue.ID = "Panel" + count; ownerValue.Style.Add("width", row["LabelWidth"] + "mm"); ownerValue.Style.Add("height", row["LabelHeight"] + "mm"); ownerValue.Style.Add("float", "left"); ownerValue.Style.Add("border", "1px solid #CCCCCC"); ownerValue.Style.Add("margin-right", row["LabelRightMargin"] + "mm"); ownerValue.Style.Add("margin-bottom", row["LabelBottomMargin"] + "mm"); temp.InstantiateIn(ownerValue); this.Controls.Add(ownerValue); ownerValue.DataBind(); count++; } return(0); }
private string _export() { StringBuilder sb = new StringBuilder(); // LINE 1 sb.AppendLine(_templateDesignerVersion.QuoteWrap()); // LINE 2 sb.AppendLine(String.Format( "{0},{1},{2}", TemplateName.QuoteWrap(), TemplateOwner.QuoteWrap(), _templateOwnerType.QuoteWrap())); sb.Append(TemplateName.QuoteWrap() + ","); sb.Append(TemplateOwner.QuoteWrap() + ","); sb.AppendLine(_templateOwnerType.QuoteWrap()); // LINE 3 - FORM sb.AppendLine(String.Format( "0,0,0,{0},{1},0,1048576,\"\",\"\",\"\"", Width, Height)); // LINE 4 - TABSTRIP sb.AppendLine(String.Format( "{0},5,377,295,395,0,32,{1},{2},{3}", (_pages.Count - 1), // page 0 doesn't count PrefixContainer.DefaultString.QuoteWrap(), ("N=1|" + _tabstripItemData.Export(":")).QuoteWrap(), (":-2147483633:" + _getPageNames()).QuoteWrap())); // LINE 5 - BROWSETREE // FWST-PedsGeneral: 0,555,10,1065,610,0,4,"","N=2|I=F|S=F|B=T","" //sb.AppendLine(String.Format(""); sb.AppendLine(String.Format( "0,{0},10,{1},610,0,4,\"\",{2},\"\"", (Width / 2), (Width - 10), _browseTreeItemData.Export().QuoteWrap())); return(sb.ToString()); }
protected override void CreateChildControls() { Controls.Clear(); _owner = new TemplateOwner(); ITemplate temp = _ContentTemplate; if (temp == null) { temp = new DefaultContentTemplate(); } temp.InstantiateIn(_owner); this.Controls.Add(_owner); }
protected override void CreateChildControls() { BodyPlace.Controls.Clear(); TemplateOwner ownerValue = new TemplateOwner(); ITemplate temp = Template; if (temp == null) return; temp.InstantiateIn(ownerValue); BodyPlace.Controls.Add(ownerValue); }
protected override int CreateChildControls(IEnumerable dataSource, bool dataBinding) { DataRow[] rows = LabelFormatData.Select("name='" + _labelFormat + "'"); if (rows.Length == 0) throw new InvalidOperationException("LabelFormat is invalid!"); DataRow row = rows[0]; // // page setup // Style.Add("Text-Align", "center"); Style.Add("padding", row["PageTopMargin"] + "mm " + row["PageRightMargin"] + "mm " + row["PageBottomMargin"] + "mm " + row["PageLeftMargin"] + "mm"); Style.Add("width", row["PageWidth"] + "mm"); Style.Add("height", row["PageHeight"] + "mm"); Controls.Clear(); ITemplate temp = templateValue ?? new DefaultTemplate(); int count = 0; foreach (object o in dataSource) { ownerValue = new TemplateOwner(o, count); ownerValue.ID = "Panel" + count; ownerValue.Style.Add("width", row["LabelWidth"] + "mm"); ownerValue.Style.Add("height", row["LabelHeight"] + "mm"); ownerValue.Style.Add("float", "left"); ownerValue.Style.Add("border", "1px solid #CCCCCC"); ownerValue.Style.Add("margin-right", row["LabelRightMargin"] + "mm"); ownerValue.Style.Add("margin-bottom", row["LabelBottomMargin"] + "mm"); temp.InstantiateIn(ownerValue); this.Controls.Add(ownerValue); ownerValue.DataBind(); count++; } return 0; }