Mar 29, 2010, 9:40 AM
[CLOSED] Unable to render controls within dynamically created TabPanel
Hi,
I am trying to add buttons within TabPanel's tab . My TabPanel is dynamic.
With my code, its rendering on top of TabPanel
Please help. My aim is to render a set of controls in tabular format.
Any help will be greatly appreciated.
//====================
//Markup Of My Page
//====================
//==Code Behind
//====================
I am trying to add buttons within TabPanel's tab . My TabPanel is dynamic.
With my code, its rendering on top of TabPanel
Please help. My aim is to render a set of controls in tabular format.
Any help will be greatly appreciated.
//====================
//Markup Of My Page
//====================
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="DynamicTabDemo.aspx.cs" Inherits="DynamicControlPopulateDemo.DynamicTabDemo" %>
<%@ Register Assembly="Coolite.Ext.Web" Namespace="Coolite.Ext.Web" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<ext:ScriptManager ID="ScriptManager1" runat="server" />
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</form>
</body>
</html>
//====================//==Code Behind
//====================
protected void Page_InIt(object sender, EventArgs e)
{
Coolite.Ext.Web.TabPanel tabs = new Coolite.Ext.Web.TabPanel();
tabs.ResizeTabs = true;
tabs.MinTabWidth = Unit.Pixel(115);
tabs.TabWidth = Unit.Pixel(135);
tabs.EnableTabScroll = true;
tabs.Width = Unit.Pixel(600);
tabs.Height = Unit.Pixel(300);
tabs.LayoutOnTabChange = true;
tabs.ActiveTabIndex = 1;
tabs.BodyBorder = false;
tabs.Border = true;
for (int i = 1; i < 4; i++)
{
Tab tab = new Tab();
tab.Title = "world " + i.ToString();
tab.IconCls = "tabs";
tab.Closable = false;
tab.BodyStyle = "padding: 6px;";
tab.Frame = false;
Coolite.Ext.Web.Panel p = new Coolite.Ext.Web.Panel();
for (int j = 0; j < i; j++)
{
Coolite.Ext.Web.Button btn = new Coolite.Ext.Web.Button();
btn.Text = "type " + i.ToString() + "_" + j.ToString();
btn.ToolTip = "description for type " + i.ToString() + "_" + j.ToString();
btn.Visible = true;
p.Controls.Add(btn);
//p.Items.Add(btn);
}
tab.Items.Add(p);
tabs.Tabs.Add(tab);
}// Add Window to Form
this.PlaceHolder1.Controls.Add(tabs);
}
Last edited by geoffrey.mcgill; Feb 20, 2015 at 2:39 PM.