This is a migrated thread and some comments may be shown as answers.

dynamically create Tadstrip

1 Answer 50 Views
TabStrip
This is a migrated thread and some comments may be shown as answers.
Agyeman
Top achievements
Rank 1
Agyeman asked on 25 Aug 2008, 09:35 PM
How do I dynamically create a radstrip and add controls to the tabs. Below is the code that doesn't work. please enghtenn me.

//Define RadtabStrip

RadTabStrip.ID =

"RadTabStrip";

RadTabStrip.BorderColor =

Color.Black;

RadTabStrip.Width =

Unit.Pixel(930);

RadTabStrip.Height =

Unit.Pixel(500);

RadTabStrip.Orientation =

TabStripOrientation.VerticalLeft;

RadTabStrip.MultiPageID =

"RadMultiPageID";

RadTabStrip.Tabs.Add(AddRadTab(

"Warnings", "WarningspageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"History", "HistoryPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Watches", "WatchPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Destination", "DestinationPageView"));

RadTabStrip.Tabs.Add(AddRadTab(

"Properties", "PropertiesPageView"));

RadMultiPage RadMultiPageID = new RadMultiPage();

RadMultiPageID.ID =

"RadMultiPageID";

RadPageView RPageView = PageView("WatchPageView");

LabelWatchName.ID =

"LabelWatchName";

LabelWatchName.Text =

"Watch Name: ";

TextBoxWatchName.ID =

"TextBoxWatchName";

TextBoxWatchName.Width =

Unit.Pixel(900);

HtmlGenericControl div = CreateDiv("watchnamedic");

div.Controls.Add(LabelWatchName);

div.Controls.Add(TextBoxWatchName);

//RPageView.Controls.Add(div);

LabelDisplayName.ID =

"LabelDisplayName";

LabelDisplayName.Text =

"Display Name: ";

TextBoxDisplayName.ID =

"TextBoxDisplayName";

TextBoxDisplayName.Width =

Unit.Pixel(500);

div = CreateDiv(

"displaynamedic");

div.Controls.Add(LabelDisplayName);

div.Controls.Add(TextBoxDisplayName);

RPageView.Controls.Add(div);

RadMultiPageID.PageViews.Add(LabelDisplayName);

Controls.Add(RadTabStrip);

}

catch (Exception e) { }

}

private RadPageView PageView(string name)

{

RadPageView radpageview = new RadPageView();

radpageview.ID =

"radpageview";

return radpageview;

}

private HtmlGenericControl CreateDiv(string divname)

{

HtmlGenericControl div = new HtmlGenericControl("div");

div.ID = divname;

return div;

}

private RadTab AddRadTab(string CurrentTabName, string PageviewID)

{

RadTab RadTab = new RadTab();

RadTab.Text = CurrentTabName;

RadTab.PageViewID = PageviewID;

return RadTab;

}

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 26 Aug 2008, 09:53 AM
Hi,

Go through the online demo which shows dynamic creation of RadTabstrip.
Dynamic Creation

Shinu.
Tags
TabStrip
Asked by
Agyeman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or