Well, here's my code on the ascx file
<asp:UpdatePanel ID="UpdatePanel" runat="server"> |
<ContentTemplate> |
<telerik:RadEditor ID="RadEditor" CssClass="RadEditor" runat="server" Width="98%"> |
</telerik:RadEditor> |
<div class="radiobuttonlist"> |
<b>Choose a toolbar style:</b> |
<asp:RadioButtonList RepeatDirection="Vertical" Width="130px" CellPadding="0" CellSpacing="0" |
OnSelectedIndexChanged="RadioButtonListEditModeSelectedIndexChanged" CssClass="text" |
ID="RadioButtonListEditMode" runat="server" AutoPostBack="True"> |
<asp:ListItem Value="FullSet">Advanced toolset</asp:ListItem> |
<asp:ListItem Value="Default">Default</asp:ListItem> |
<asp:ListItem Value="BasicTools">Basic toolset</asp:ListItem> |
</asp:RadioButtonList> |
</div> |
</ContentTemplate> |
</asp:UpdatePanel> |
I'm trying to do the same on the code behind. I create a tabstrip programmatically and I want in each pageview to have an update control that does the same as the above. The above is part of the Overview example of RadEditor. My code behind is this :
protected void Tabstrip1TabDataBound(object sender, RadTabStripEventArgs e) |
{ |
RadPageView newpage = new RadPageView(); |
RadEditor editor = new RadEditor {ID = "radeditor" + e.Tab.Index}; |
UpdatePanel updatepanel = new UpdatePanel {ID = "updatepanel" + e.Tab.Index}; |
updatepanel.UpdateMode = UpdatePanelUpdateMode.Conditional; |
//RadioButtonList Start |
RadioButtonList rbl = new RadioButtonList(); |
rbl.RepeatDirection = RepeatDirection.Vertical; |
rbl.Width = 130; |
rbl.SelectedIndexChanged += new EventHandler(RadioButtonListEditModeSelectedIndexChanged); |
rbl.AutoPostBack = true; |
ListItem li1 = new ListItem(); |
ListItem li2 = new ListItem(); |
ListItem li3 = new ListItem(); |
rbl.ID = "radiobuttonlist" + e.Tab.Index; |
li1.Value = "FullSet"; |
li1.Text = "Advanced toolset"; |
li2.Value = "Default"; |
li2.Text = "Default"; |
li3.Value = "BasicTools"; |
li3.Text = "Basic toolset"; |
rbl.Items.Add(li1); |
rbl.Items.Add(li2); |
rbl.Items.Add(li3); |
//RadioButtonList End |
Literal ltr = new Literal |
{ |
Text = "<div class=\"radiobuttonlist\"><b>Choose a toolbar style:</b>" |
}; |
Literal ltr2 = new Literal {Text = "</div>"}; |
updatepanel.ContentTemplateContainer.Controls.Add(editor); |
updatepanel.ContentTemplateContainer.Controls.Add(ltr); |
updatepanel.ContentTemplateContainer.Controls.Add(rbl); |
updatepanel.ContentTemplateContainer.Controls.Add(ltr2); |
newpage.Controls.Add(updatepanel); |
multipage1.PageViews.Add(newpage); |
} |
I'm really stuck and that's why I'm turning here. Any help or visible errors? My problem is that when I create it programmatically, it's like the UpdatePanel doesn't work. The RadioButtonList just posts back on the page...