PDA

View Full Version : [CLOSED] TabStrip with ActionContainerID question



ViDom
Apr 02, 2012, 2:28 PM
Hello,
How can i add TabStrip with ActionContainerID to an ASP.NET Web Page Programmatically?
Best Regards
ViDom

Daniil
Apr 02, 2012, 3:04 PM
Hi,

Please clarify do you use Ext.NET v1 or v2?

ViDom
Apr 02, 2012, 3:06 PM
Hi,

Please clarify do you use Ext.NET v1 or v2?

I use version 2 latest.

Daniil
Apr 02, 2012, 7:23 PM
Thanks.

Do you need to add a TabStrip for already rendered "ActionContainerID"?

If so, it's not supported. You will need to re-render the "ActionContainerID" container.

Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void CreateTabStrip(object sender, DirectEventArgs e)
{
TabStrip tabStrip = new TabStrip()
{
ID = "TabStrip1",
ActionContainerID = "Panel1",
Items =
{
new Tab("Summary"),
new Tab("Data")
}
};

Toolbar1.Items.Add(tabStrip);

this.Panel1.Render();

tabStrip.SetActiveTab(0);
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="Create TabStrip" OnDirectClick="CreateTabStrip" />

<ext:Panel
ID="Panel1"
runat="server"
Height="105"
Width="350"
Layout="CardLayout"
ActiveIndex="0"
DefaultBorder="false"
DefaultPadding="5">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server" StyleSpec="padding-bottom:0px;" />
</TopBar>
<Items>
<ext:Panel runat="server" Html="Summary" Header="false" />
<ext:Panel runat="server" Html="Data" Header="false" />
</Items>
</ext:Panel>
</form>
</body>
</html>

ViDom
Apr 03, 2012, 8:06 AM
How can i add to tabs items like other controls from code?
For example u add here plain html text

<Items>
<ext:Panel runat="server" Html="Summary" Header="false" />
<ext:Panel runat="server" Html="Data" Header="false" />
</Items>
And i wanna add in each panel my own controls Like Labels/Buttons/etc.

Daniil
Apr 03, 2012, 12:56 PM
Example

<%@ Page Language="C#" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>

<script runat="server">
protected void CreateTabStrip(object sender, DirectEventArgs e)
{
TabStrip tabStrip = new TabStrip()
{
ID = "TabStrip1",
ActionContainerID = "Panel1",
Items =
{
new Tab("Summary"),
new Tab("Data")
}
};

Toolbar1.Items.Add(tabStrip);

Ext.Net.Panel tab1 = new Ext.Net.Panel()
{
Items =
{
new Ext.Net.Label("Tab 1")
}
};

this.Panel1.Items.Add(tab1);

Ext.Net.Panel tab2 = new Ext.Net.Panel()
{
Items =
{
new Ext.Net.Label("Tab 2")
}
};

this.Panel1.Items.Add(tab2);

this.Panel1.Render();

tabStrip.SetActiveTab(0);
}
</script>

<!DOCTYPE html>

<html>
<head runat="server">
<title>Ext.NET v2 Example</title>
</head>
<body>
<form runat="server">
<ext:ResourceManager runat="server" />

<ext:Button runat="server" Text="Create TabStrip" OnDirectClick="CreateTabStrip" />

<ext:Panel
ID="Panel1"
runat="server"
Height="105"
Width="350"
Layout="CardLayout"
DefaultBorder="false"
DefaultPadding="5">
<TopBar>
<ext:Toolbar ID="Toolbar1" runat="server" StyleSpec="padding-bottom:0px;" />
</TopBar>
</ext:Panel>
</form>
</body>
</html>