Sep 24, 2008, 10:22 AM
[CLOSED] Rendering butons on a row in a tab
In the example I add buttons in a Tab of a TabPanel (taking data from an external class called pmappa). It's all dinamically built. The problem there is the buttons are shown in a column (one under the other) and not in a row. I tried to figure out how to change the layout but couldn't get it out.
I also have one more question: is there a way to dynamically add event handlers to work at server side?
Sorry if these things have been already discussed, but not having any documentation make things a bit difficult to me.
I also have one more question: is there a way to dynamically add event handlers to work at server side?
Sorry if these things have been already discussed, but not having any documentation make things a bit difficult to me.
protected void Render_pmappa(pmappa m)
{
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(80);
tabs.ActiveTab = 0;
tabs.BodyBorder = false;
tabs.Border = true;
for (int i = 1; i <= m.mondi.Count; i++)
{
Coolite.Ext.Web.Tab tab = new Coolite.Ext.Web.Tab();
tab.Title = m.mondi[i].nome;
tab.IconCls = "tabs";
tab.Closable = false;
tab.BodyStyle = "padding: 6px;";
foreach (ptipo pt in m.mondi[i].tipi.Values)
{
Coolite.Ext.Web.Button btn = new Coolite.Ext.Web.Button();
btn.Text = pt.nome;
btn.ToolTip = pt.descrizione;
btn.Visible = true;
tab.ContentControls.Add(btn);
tab.Frame = false;
bool b = tab.HasLayout();
}
tabs.Tabs.Add(tab);
}
this.PlaceHolder1.Controls.Add(tabs);
}