i have create tab and alone with it's pageview .it's work fine for deleting i add close image button to another class .(i.e. add tab and pageview in one class and deleting tab in another class) tab is deleting but pageview of that tab is not delete.how can i delete tab alone with pageview.pls help me
17 Answers, 1 is accepted
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 25 Nov 2013, 07:16 AM
Hi Suresh,
Please have a look into the following code snippet to delete both RadTab and RadPageView.
ASPX:
C#:
Thanks,
Shinu.
Please have a look into the following code snippet to delete both RadTab and RadPageView.
ASPX:
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
MultiPageID
=
"RadMultiPage1"
OnTabClick
=
"RadTabStrip1_TabClick"
AutoPostBack
=
"true"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Tab1"
runat
=
"server"
PageViewID
=
"RadPageView1"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Delete Tab1"
runat
=
"server"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage1"
runat
=
"server"
>
<
telerik:RadPageView
ID
=
"RadPageView1"
runat
=
"server"
>
<
telerik:RadButton
ID
=
"RadButton1"
runat
=
"server"
Text
=
"Demo"
>
</
telerik:RadButton
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
C#:
protected
void
RadTabStrip1_TabClick(
object
sender, Telerik.Web.UI.RadTabStripEventArgs e)
{
if
(e.Tab.Text ==
"Delete tab1"
)
{
RadTab tab = (RadTab)RadTabStrip1.FindTabByText(
"Tab1"
);
// delete tab
RadTabStrip1.Tabs.Remove(tab);
RadPageView page = (RadPageView)RadMultiPage1.FindPageViewByID(
"RadPageView1"
);
//delete pageview
RadMultiPage1.PageViews.Remove(page);
}
}
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 25 Nov 2013, 01:57 PM
i have created multiple tab and there pageview .i want delete tab alone with pageview.pls help.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 25 Nov 2013, 02:20 PM
I am creating tabs and page views dynamically using code. I am attaching the close button on which my tabs will be closed. I am uploading different content url for the pageviews. My question is when i am deleting a single tab the content url of other tabs are lost i.e the pageviews disappears.How can i preserve my pageviews. What code has to be written in
protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
.
My code is as follows:
MY aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Result1.aspx.cs" Inherits="Result1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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></title>
<link href="Styles/teleriktab.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function onClientTabSelecting(sender, args) {
var tab = args.get_tab();
if (tab.get_pageView()) {
tab.set_postBack(false);
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadMultiPage1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
<%-- <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" />--%>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div class="exampleWrapper">
<telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop" Width="760"
OnTabClick="RadTabStrip1_TabClick" MultiPageID="RadMultiPage1" Skin="Windows7"
OnClientTabSelecting="onClientTabSelecting" SelectedIndex="0" >
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="760" Height="380" SelectedIndex="0"
OnPageViewCreated="RadMultiPage1_PageViewCreated">
<telerik:RadPageView ID="RadPageView1" runat="server">
<%--<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadTabStrip1"> <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<%--<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" skin="Outlook" >
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnablePageHeadUpdate="true">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadTabStrip1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadMultiPage1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<%-- <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"
OnClientTabSelecting="onClientTabSelecting" ClickSelectedTab="true" Orientation="HorizontalTop"
OnTabClick="RadTabStrip1_TabClick" ScrollChildren="True"
ScrollButtonsPosition="Middle" PerTabScrolling="True"
ScrollPosition="0" ShowBaseLine="True" Font-Size="8" MultiPageID="RadMultiPage1" ForeColor="Blue" skin="Outlook" font-color="Blue" AutoPostBack="true" >
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Height="465px"
onpageviewcreated="RadMultiPage1_PageViewCreated" >
</telerik:RadMultiPage>--%>
</telerik:RadPageView>
</telerik:RadMultiPage>
</div>
<div>
</div>
</form>
</body>
</html>
And my code behind file is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using AjaxControlToolkit;
public partial class Default2 : System.Web.UI.Page
{
//AjaxControlToolkit.TabContainer.tbcDyanamic;
protected void Page_Load(object sender, EventArgs e)
{
if (k == 1)
{
}
if (!Page.IsPostBack)
{
RadTabStrip1.Tabs.Clear();
for (int i = 1; i < 9; i++)
{
RadTab tab = new RadTab();
tab.Text = "Result " + i;
tab.NavigateUrl = "Default2.aspx";
//tab.Text = "Result " + RadTabStrip1.Tabs.Count;
RadTabStrip1.Tabs.Add(tab);
//RadTabStrip1.Tabs.Insert(0, tab);
RadTabStrip1.SelectedIndex = tab.Index;
//RadTab tab = new RadTab();
//tab.Text = "Result " + i;
// tab.Height = System.Web.UI.WebControls.Unit.Pixel(25);
tab.Value = "newTabValue";
//RadTabStrip1.Tabs.Insert(0, tab);
//tab.NavigateUrl = "Search.aspx";
RadPageView pageView = new RadPageView();
//tab.PageViewID = pageView.ID;
//Always assign the ID of the pageview
pageView.ID = "PageView" + Guid.NewGuid().ToString();
pageView.ContentUrl = ls[i];
RadMultiPage1.PageViews.Add(pageView);
//Call the DataBind method so any databinding expressions in the TabTemplate are evaluated ( <%# DataBinder.Eval (...) )
RadTabStrip1.DataBind();
//Add two tabs and two pageviews
//AddTabAndPageView();
//Call the DataBind method so any databinding expressions in the TabTemplate are evaluated ( <%# DataBinder.Eval (...) )
//RadTabStrip1.DataBind();
}
}
else
{
}
}
//private void BindTabStripCloseButton()
//{
// Default2 template = new Default2();
// foreach (RadTab tab in RadTabStrip1.GetAllTabs())
// {
// //template.InstantiateIn(tab);
// }
// RadTabStrip1.DataBind();
// // //RadMultiPage1.PageViews.Clear();
//}
protected void DeleteButton_Click(object sender, ImageClickEventArgs e)
{
dynamic clickedTab = (RadTab)((ImageButton)sender).Parent;
DeleteTabAndPageView(clickedTab);
}
protected void Page_Init(object sender, System.EventArgs e)
{
//Create a new tabstrip and add it to the placeholder
//RadTabStrip RadTabStrip1 = new RadTabStrip();
RadTabStrip1.ID = "RadTabStrip1";
RadTabStrip1.SelectedIndex = 0;
PlaceHolder1.Controls.Add(RadTabStrip1);
//Subscribe to the TabCreated event - in the event handler we will add the image button control
RadTabStrip1.TabCreated += this.RadTabStrip1_TabCreated;
//Create a new multipage and add it to the placeholder
//RadMultiPage RadMultiPage1 = new RadMultiPage();
RadMultiPage1.ID = "RadMultiPage1";
RadMultiPage1.SelectedIndex = 0;
PlaceHolder1.Controls.Add(RadMultiPage1);
//Subscribte to the PageViewCreated event - in the event handler we will populate the pageview with controls
RadMultiPage1.PageViewCreated += this.RadMultiPage1_PageViewCreated;
//Wire up the tabstrip and the multipage
RadTabStrip1.MultiPageID = "RadMultiPage1";
}
protected void RadTabStrip1_TabCreated(object sender, RadTabStripEventArgs e)
{
ImageButton button = new ImageButton();
button.ImageUrl = "~/delete.gif";
button.Click += this.DeleteButton_Click;
e.Tab.Controls.Add(new LiteralControl(e.Tab.Text));
e.Tab.Controls.Add(button);
}
//private void AddTabAndPageView()
//{
//}
private void DeleteTabAndPageView(RadTab tab)
{
//Get the associated pageview
RadPageView pageView = tab.PageView;
//RadMultiPage1.PageViews.RemoveAt(RadMultiPage1.SelectedIndex);
RadMultiPage1.PageViews.Remove(pageView);
RadTabStrip1.Tabs.Remove(tab);
}
protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
{
//Label target = (Label)sender;
//RadTab tab = (RadTab)target.BindingContainer;
//string tabText = (string)DataBinder.Eval(tab, "Text");
//target.Text = tabText;
Label pageViewContents = new Label();
pageViewContents.ID = e.PageView.ID + "Label";
// RadMultiPage1.SelectedIndex = e.PageView.TabIndex;
//pageViewContents.Text = "PreviousPage" + e.PageView.TabIndex;
//pageViewContents.Page ="http://www.blubaker.com";
e.PageView.Controls.Add(pageViewContents);
}
//protected void AddTabButton_Click(object sender, System.EventArgs e)
//{
// AddTabAndPageView();
//}
public void AddRemoveTabs()
{
Load += Page_Load;
Init += Page_Init;
}
}
protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
.
My code is as follows:
MY aspx page:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Result1.aspx.cs" Inherits="Result1" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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></title>
<link href="Styles/teleriktab.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
function onClientTabSelecting(sender, args) {
var tab = args.get_tab();
if (tab.get_pageView()) {
tab.set_postBack(false);
}
}
</script>
</telerik:RadCodeBlock>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"></telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadMultiPage1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
<%-- <telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="RadAjaxLoadingPanel1" />--%>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
<div class="exampleWrapper">
<telerik:RadTabStrip runat="server" ID="RadTabStrip1" Orientation="HorizontalTop" Width="760"
OnTabClick="RadTabStrip1_TabClick" MultiPageID="RadMultiPage1" Skin="Windows7"
OnClientTabSelecting="onClientTabSelecting" SelectedIndex="0" >
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Width="760" Height="380" SelectedIndex="0"
OnPageViewCreated="RadMultiPage1_PageViewCreated">
<telerik:RadPageView ID="RadPageView1" runat="server">
<%--<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadTabStrip1"> <UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<%--<telerik:RadAjaxLoadingPanel runat="server" ID="LoadingPanel1" skin="Outlook" >
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" EnablePageHeadUpdate="true">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="RadTabStrip1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1"></telerik:AjaxUpdatedControl>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1" LoadingPanelID="LoadingPanel1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="RadMultiPage1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadMultiPage1"></telerik:AjaxUpdatedControl>
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<%-- <telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"
OnClientTabSelecting="onClientTabSelecting" ClickSelectedTab="true" Orientation="HorizontalTop"
OnTabClick="RadTabStrip1_TabClick" ScrollChildren="True"
ScrollButtonsPosition="Middle" PerTabScrolling="True"
ScrollPosition="0" ShowBaseLine="True" Font-Size="8" MultiPageID="RadMultiPage1" ForeColor="Blue" skin="Outlook" font-color="Blue" AutoPostBack="true" >
</telerik:RadTabStrip>
<telerik:RadMultiPage ID="RadMultiPage1" runat="server" Height="465px"
onpageviewcreated="RadMultiPage1_PageViewCreated" >
</telerik:RadMultiPage>--%>
</telerik:RadPageView>
</telerik:RadMultiPage>
</div>
<div>
</div>
</form>
</body>
</html>
And my code behind file is as follows:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using AjaxControlToolkit;
public partial class Default2 : System.Web.UI.Page
{
//AjaxControlToolkit.TabContainer.tbcDyanamic;
protected void Page_Load(object sender, EventArgs e)
{
if (k == 1)
{
}
if (!Page.IsPostBack)
{
RadTabStrip1.Tabs.Clear();
for (int i = 1; i < 9; i++)
{
RadTab tab = new RadTab();
tab.Text = "Result " + i;
tab.NavigateUrl = "Default2.aspx";
//tab.Text = "Result " + RadTabStrip1.Tabs.Count;
RadTabStrip1.Tabs.Add(tab);
//RadTabStrip1.Tabs.Insert(0, tab);
RadTabStrip1.SelectedIndex = tab.Index;
//RadTab tab = new RadTab();
//tab.Text = "Result " + i;
// tab.Height = System.Web.UI.WebControls.Unit.Pixel(25);
tab.Value = "newTabValue";
//RadTabStrip1.Tabs.Insert(0, tab);
//tab.NavigateUrl = "Search.aspx";
RadPageView pageView = new RadPageView();
//tab.PageViewID = pageView.ID;
//Always assign the ID of the pageview
pageView.ID = "PageView" + Guid.NewGuid().ToString();
pageView.ContentUrl = ls[i];
RadMultiPage1.PageViews.Add(pageView);
//Call the DataBind method so any databinding expressions in the TabTemplate are evaluated ( <%# DataBinder.Eval (...) )
RadTabStrip1.DataBind();
//Add two tabs and two pageviews
//AddTabAndPageView();
//Call the DataBind method so any databinding expressions in the TabTemplate are evaluated ( <%# DataBinder.Eval (...) )
//RadTabStrip1.DataBind();
}
}
else
{
}
}
//private void BindTabStripCloseButton()
//{
// Default2 template = new Default2();
// foreach (RadTab tab in RadTabStrip1.GetAllTabs())
// {
// //template.InstantiateIn(tab);
// }
// RadTabStrip1.DataBind();
// // //RadMultiPage1.PageViews.Clear();
//}
protected void DeleteButton_Click(object sender, ImageClickEventArgs e)
{
dynamic clickedTab = (RadTab)((ImageButton)sender).Parent;
DeleteTabAndPageView(clickedTab);
}
protected void Page_Init(object sender, System.EventArgs e)
{
//Create a new tabstrip and add it to the placeholder
//RadTabStrip RadTabStrip1 = new RadTabStrip();
RadTabStrip1.ID = "RadTabStrip1";
RadTabStrip1.SelectedIndex = 0;
PlaceHolder1.Controls.Add(RadTabStrip1);
//Subscribe to the TabCreated event - in the event handler we will add the image button control
RadTabStrip1.TabCreated += this.RadTabStrip1_TabCreated;
//Create a new multipage and add it to the placeholder
//RadMultiPage RadMultiPage1 = new RadMultiPage();
RadMultiPage1.ID = "RadMultiPage1";
RadMultiPage1.SelectedIndex = 0;
PlaceHolder1.Controls.Add(RadMultiPage1);
//Subscribte to the PageViewCreated event - in the event handler we will populate the pageview with controls
RadMultiPage1.PageViewCreated += this.RadMultiPage1_PageViewCreated;
//Wire up the tabstrip and the multipage
RadTabStrip1.MultiPageID = "RadMultiPage1";
}
protected void RadTabStrip1_TabCreated(object sender, RadTabStripEventArgs e)
{
ImageButton button = new ImageButton();
button.ImageUrl = "~/delete.gif";
button.Click += this.DeleteButton_Click;
e.Tab.Controls.Add(new LiteralControl(e.Tab.Text));
e.Tab.Controls.Add(button);
}
//private void AddTabAndPageView()
//{
//}
private void DeleteTabAndPageView(RadTab tab)
{
//Get the associated pageview
RadPageView pageView = tab.PageView;
//RadMultiPage1.PageViews.RemoveAt(RadMultiPage1.SelectedIndex);
RadMultiPage1.PageViews.Remove(pageView);
RadTabStrip1.Tabs.Remove(tab);
}
protected void RadMultiPage1_PageViewCreated(object sender, Telerik.Web.UI.RadMultiPageEventArgs e)
{
//Label target = (Label)sender;
//RadTab tab = (RadTab)target.BindingContainer;
//string tabText = (string)DataBinder.Eval(tab, "Text");
//target.Text = tabText;
Label pageViewContents = new Label();
pageViewContents.ID = e.PageView.ID + "Label";
// RadMultiPage1.SelectedIndex = e.PageView.TabIndex;
//pageViewContents.Text = "PreviousPage" + e.PageView.TabIndex;
//pageViewContents.Page ="http://www.blubaker.com";
e.PageView.Controls.Add(pageViewContents);
}
//protected void AddTabButton_Click(object sender, System.EventArgs e)
//{
// AddTabAndPageView();
//}
public void AddRemoveTabs()
{
Load += Page_Load;
Init += Page_Init;
}
}
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 26 Nov 2013, 04:57 AM
Hi Suresh,
Please have a look into the sample code snippet which works fine at my end.
ASPX:
C#:
Let me know if you have any concern.
Thanks,
Shinu.
Please have a look into the sample code snippet which works fine at my end.
ASPX:
<
telerik:RadTabStrip
ID
=
"RadTabStrip1"
runat
=
"server"
MultiPageID
=
"RadMultipage1"
OnTabCreated
=
"RadTabStrip1_TabCreated"
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"RadMultipage1"
runat
=
"server"
OnPageViewCreated
=
"RadMultipage1_PageViewCreated"
>
</
telerik:RadMultiPage
>
C#:
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
for
(
int
i = 0; i < 3; i++)
{
RadTab tab =
new
RadTab();
tab.Text =
"Tab"
+ i;
tab.NavigateUrl =
"Default3.aspx"
;
RadTabStrip1.Tabs.Add(tab);
RadPageView pageView =
new
RadPageView();
pageView.ID =
"PageView"
+ i;
RadMultipage1.PageViews.Add(pageView);
}
}
}
protected
void
RadTabStrip1_TabCreated(
object
sender, RadTabStripEventArgs e)
{
ImageButton button =
new
ImageButton();
button.ImageUrl =
"~/plus.gif"
;
button.Click +=
new
ImageClickEventHandler(button_Click);
e.Tab.Controls.Add(
new
LiteralControl(e.Tab.Text));
e.Tab.Controls.Add(button);
}
void
button_Click(
object
sender, ImageClickEventArgs e)
{
dynamic clickedTab = (RadTab)((ImageButton)sender).Parent;
DeleteTabAndPageView(clickedTab);
}
private
void
DeleteTabAndPageView(RadTab tab)
{
RadPageView pageView = tab.PageView;
RadMultipage1.PageViews.Remove(pageView);
RadTabStrip1.Tabs.Remove(tab);
}
protected
void
RadMultipage1_PageViewCreated(
object
sender, RadMultiPageEventArgs e)
{
//set the content url of the radpageview
e.PageView.ContentUrl =
"Grudandtab.aspx"
;
}
Let me know if you have any concern.
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 26 Nov 2013, 06:18 AM
hi shinu,
it give same url to all pageview .my pageview url is different for different tab.
pls give me code for this
it give same url to all pageview .my pageview url is different for different tab.
protected
void
RadMultipage1_PageViewCreated (
object
sender, RadMultiPageEventArgs e)
{
//set the content url of the radpageview
e.PageView.ContentUrl =
"Grudandtab.aspx"
;
}
RadMultipage1_PageViewCreated
() .that give Different url according to tab click.0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 26 Nov 2013, 07:04 AM
My point is i when i am creating tabs, i am assigning different pageviews i.e different content url.
for example, when my first tab is created it will display google page in pageview, on second tab it will display yahoo page and so on.
The problem which i am facing is that when i delete the tab of pageview yahoo , the pageview of google disappears. How can i retain those pageviews?
If i dont write the below code, my tabs are deleting but the last pageview is maintained. It doesnt disappear i.e all tabs are deleted but the pageview doesnt disappear. What would be the solution?
for example, when my first tab is created it will display google page in pageview, on second tab it will display yahoo page and so on.
The problem which i am facing is that when i delete the tab of pageview yahoo , the pageview of google disappears. How can i retain those pageviews?
If i dont write the below code, my tabs are deleting but the last pageview is maintained. It doesnt disappear i.e all tabs are deleted but the pageview doesnt disappear. What would be the solution?
protected
void
RadMultipage1_PageViewCreated(
object
sender, RadMultiPageEventArgs e)
{
//set the content url of the radpageview
e.PageView.ContentUrl =
"Grudandtab.aspx"
;
}
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 27 Nov 2013, 03:18 AM
Hi Suresh,
Please have a look into the following code snippet which works fine at my end.
C#:
Thanks,
Shinu.
Please have a look into the following code snippet which works fine at my end.
C#:
// string array which holds the url
string
[] url =
new
string
[] {
"Default.aspx"
,
"Default2.aspx"
,
"Default3.aspx"
};
public
int
index = 0;
protected
void
RadMultipage1_PageViewCreated(
object
sender, RadMultiPageEventArgs e)
{
//set the content url of the radpageview
e.PageView.ContentUrl = url[index];
index++;
}
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 27 Nov 2013, 05:10 AM
thanx Shinu for your post but what if the urls are dynamic. consider my example in which i provide a drop down list which has items like google , yahoo , etc. If i click on any item a new tab should open with the respective content i.e if i click on google a new tab with content as google page should open and like vice for yahoo. I can click on any item as many times as i can and each click should respond me with a new tab with the respective content. I have spent almost a month in doing his stuff and got stuck at this point. Please help me out.
0
Hello Suresh,
I had prepared a sample project for you, demonstrating a possible implementation, when selecting from a dropdown, in order to add dynamically RadTabs and the associated PageViews, along with their ContentUrl set. Would you give it a try at your end and let us know if this is the scenario you attempt to achieve. If not, please specify how your scenario differs and if you experience any issues, if the demonstrated approach is used.
Note : dll files are removed from the attachment.
Regards,
Nencho
Telerik
I had prepared a sample project for you, demonstrating a possible implementation, when selecting from a dropdown, in order to add dynamically RadTabs and the associated PageViews, along with their ContentUrl set. Would you give it a try at your end and let us know if this is the scenario you attempt to achieve. If not, please specify how your scenario differs and if you experience any issues, if the demonstrated approach is used.
Note : dll files are removed from the attachment.
Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 28 Nov 2013, 02:00 PM
i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem.
<telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"
OnClientTabSelecting="onClientTabSelecting" ClickSelectedTab="true" Orientation="HorizontalTop"
ScrollChildren="True" OnTabCreated="RadTabStrip1_TabCreated"
ScrollButtonsPosition="middle" PerTabScrolling="true"
ScrollPosition="0" ShowBaseLine="True" Font-Size="8" MultiPageID="RadMultiPage1" ForeColor="Blue" font-color="Blue" >
</telerik:RadTabStrip>
<telerik:RadTabStrip ID="RadTabStrip1" SelectedIndex="0" runat="server"
OnClientTabSelecting="onClientTabSelecting" ClickSelectedTab="true" Orientation="HorizontalTop"
ScrollChildren="True" OnTabCreated="RadTabStrip1_TabCreated"
ScrollButtonsPosition="middle" PerTabScrolling="true"
ScrollPosition="0" ShowBaseLine="True" Font-Size="8" MultiPageID="RadMultiPage1" ForeColor="Blue" font-color="Blue" >
</telerik:RadTabStrip>
0
![](/forums/images/avatarimages/default.gif)
Mak
Top achievements
Rank 1
answered on 28 Nov 2013, 02:19 PM
Hi Shinu.
Actually I am working with telerik ribbon and i got stuck at a point that if i want that i should show only particular ribbon header to particular user and disable rest. And I should show all ribbon header to specific user. Is it possible?
Actually I am working with telerik ribbon and i got stuck at a point that if i want that i should show only particular ribbon header to particular user and disable rest. And I should show all ribbon header to specific user. Is it possible?
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 29 Nov 2013, 11:25 AM
i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
<%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<div class="exampleWrapper">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
SelectedIndex="0">
<Tabs>
<telerik:RadTab Text="Advanced">
</telerik:RadTab>
<telerik:RadTab Text="Automatic Updates">
</telerik:RadTab>
<telerik:RadTab Text="Remote">
</telerik:RadTab>
<telerik:RadTab Text="General">
</telerik:RadTab>
<telerik:RadTab Text="Computer Name">
</telerik:RadTab>
<telerik:RadTab Text="Hardware">
</telerik:RadTab>
<telerik:RadTab Text="System Restore">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</div>
<%-- <div style="clear: both;"></div>--%>
</form>
</body>
</html>
my code behind file:
using Telerik.Web.UI;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var tabTemplate = new TabTemplate();
foreach (RadTab tab in RadTabStrip1.Tabs)
{
tabTemplate.InstantiateIn(tab);
}
}
protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
{
// RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
}
protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
{
//RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
//RadTabStrip1.ScrollPosition = 0;
}
public class TabTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
Label label1 = new Label();
label1.ID = "ItemLabel";
label1.Text = (container as RadTab).Text;
container.Controls.Add(label1);
ImageButton imgRemove = new ImageButton();
imgRemove.Init += imgRemove_Init;
imgRemove.ID = "ImageButton1";
imgRemove.Width = Unit.Pixel(9);
imgRemove.Height = Unit.Pixel(9);
imgRemove.ImageUrl = "~/cut.png";
container.Controls.Add(imgRemove);
}
void imgRemove_Init(object sender, EventArgs e)
{
ImageButton img = (ImageButton)sender;
img.Click += imgRemove_Click;
}
void imgRemove_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = (ImageButton)sender;
RadTab tab = img.Parent as RadTab;
tab.TabStrip.SelectedIndex = tab.Index - 1;
tab.TabStrip.Tabs.Remove(tab);
}
}
protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
{
}
}
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
<%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<div class="exampleWrapper">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
SelectedIndex="0">
<Tabs>
<telerik:RadTab Text="Advanced">
</telerik:RadTab>
<telerik:RadTab Text="Automatic Updates">
</telerik:RadTab>
<telerik:RadTab Text="Remote">
</telerik:RadTab>
<telerik:RadTab Text="General">
</telerik:RadTab>
<telerik:RadTab Text="Computer Name">
</telerik:RadTab>
<telerik:RadTab Text="Hardware">
</telerik:RadTab>
<telerik:RadTab Text="System Restore">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</div>
<%-- <div style="clear: both;"></div>--%>
</form>
</body>
</html>
my code behind file:
using Telerik.Web.UI;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var tabTemplate = new TabTemplate();
foreach (RadTab tab in RadTabStrip1.Tabs)
{
tabTemplate.InstantiateIn(tab);
}
}
protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
{
// RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
}
protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
{
//RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
//RadTabStrip1.ScrollPosition = 0;
}
public class TabTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
Label label1 = new Label();
label1.ID = "ItemLabel";
label1.Text = (container as RadTab).Text;
container.Controls.Add(label1);
ImageButton imgRemove = new ImageButton();
imgRemove.Init += imgRemove_Init;
imgRemove.ID = "ImageButton1";
imgRemove.Width = Unit.Pixel(9);
imgRemove.Height = Unit.Pixel(9);
imgRemove.ImageUrl = "~/cut.png";
container.Controls.Add(imgRemove);
}
void imgRemove_Init(object sender, EventArgs e)
{
ImageButton img = (ImageButton)sender;
img.Click += imgRemove_Click;
}
void imgRemove_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = (ImageButton)sender;
RadTab tab = img.Parent as RadTab;
tab.TabStrip.SelectedIndex = tab.Index - 1;
tab.TabStrip.Tabs.Remove(tab);
}
}
protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
{
}
}
0
![](/forums/images/avatarimages/39919b70-532f-465f-8efd-7edb2fc108a71.jpg)
Shinu
Top achievements
Rank 2
answered on 30 Nov 2013, 09:42 AM
Hi Mak,
Please have a look into the following code snippet to hide the RadRibbonBarTab based on the user role.
C#:
Thanks,
Shinu.
Please have a look into the following code snippet to hide the RadRibbonBarTab based on the user role.
C#:
if
(Session[
"userrole"
].ToString() ==
"guest"
)
{
RadRibbonBar1.FindTabByValue(
"1"
).Visible =
false
;
}
Thanks,
Shinu.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 02 Dec 2013, 04:46 AM
hi shinu
i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem. pls help me fast.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
<%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<div class="exampleWrapper">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
SelectedIndex="0">
<Tabs>
<telerik:RadTab Text="Advanced">
</telerik:RadTab>
<telerik:RadTab Text="Automatic Updates">
</telerik:RadTab>
<telerik:RadTab Text="Remote">
</telerik:RadTab>
<telerik:RadTab Text="General">
</telerik:RadTab>
<telerik:RadTab Text="Computer Name">
</telerik:RadTab>
<telerik:RadTab Text="Hardware">
</telerik:RadTab>
<telerik:RadTab Text="System Restore">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</div>
<%-- <div style="clear: both;"></div>--%>
</form>
</body>
</html>
my code behind file:
using Telerik.Web.UI;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var tabTemplate = new TabTemplate();
foreach (RadTab tab in RadTabStrip1.Tabs)
{
tabTemplate.InstantiateIn(tab);
}
}
protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
{
// RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
}
protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
{
//RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
//RadTabStrip1.ScrollPosition = 0;
}
public class TabTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
Label label1 = new Label();
label1.ID = "ItemLabel";
label1.Text = (container as RadTab).Text;
container.Controls.Add(label1);
ImageButton imgRemove = new ImageButton();
imgRemove.Init += imgRemove_Init;
imgRemove.ID = "ImageButton1";
imgRemove.Width = Unit.Pixel(9);
imgRemove.Height = Unit.Pixel(9);
imgRemove.ImageUrl = "~/cut.png";
container.Controls.Add(imgRemove);
}
void imgRemove_Init(object sender, EventArgs e)
{
ImageButton img = (ImageButton)sender;
img.Click += imgRemove_Click;
}
void imgRemove_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = (ImageButton)sender;
RadTab tab = img.Parent as RadTab;
tab.TabStrip.SelectedIndex = tab.Index - 1;
tab.TabStrip.Tabs.Remove(tab);
}
}
protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
{
}
}
i am creating tab by using tabstrip with scrolling for multitab .when multiple tab is created like for e.g consider the no. of tabs as 14. initially the scrolling appears but when i am deleting tab from 14,13, and so on at a point like when i am at tab 8 after deleting the scrolling disappears along with the starting tabs i.e tab1,tab2,tab3. Scrolling disappearing at a point is right but the starting tabs are hidden which causes a problem. pls help me fast.
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<title></title>
<link href="Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
<%-- <telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />
<telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" />--%>
<%--<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="ScrollButtonsOptionsList">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="PerTabScrollingCheckBox">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadTabStrip1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>--%>
<div class="exampleWrapper">
<telerik:RadTabStrip ID="RadTabStrip1" runat="server" Width="400px" ScrollChildren="true" ScrollButtonsPosition="Middle" PerTabScrolling="true" ScrollPosition="0"
SelectedIndex="0">
<Tabs>
<telerik:RadTab Text="Advanced">
</telerik:RadTab>
<telerik:RadTab Text="Automatic Updates">
</telerik:RadTab>
<telerik:RadTab Text="Remote">
</telerik:RadTab>
<telerik:RadTab Text="General">
</telerik:RadTab>
<telerik:RadTab Text="Computer Name">
</telerik:RadTab>
<telerik:RadTab Text="Hardware">
</telerik:RadTab>
<telerik:RadTab Text="System Restore">
</telerik:RadTab>
</Tabs>
</telerik:RadTabStrip>
</div>
<%-- <div style="clear: both;"></div>--%>
</form>
</body>
</html>
my code behind file:
using Telerik.Web.UI;
public partial class Default2 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
var tabTemplate = new TabTemplate();
foreach (RadTab tab in RadTabStrip1.Tabs)
{
tabTemplate.InstantiateIn(tab);
}
}
protected void ScrollButtonsOptionsList_SelectedIndexChanged(object sender, EventArgs e)
{
// RadTabStrip1.ScrollButtonsPosition = (TabStripScrollButtonsPosition)Enum.Parse(typeof(TabStripScrollButtonsPosition), ((RadioButtonList)sender).SelectedValue);
}
protected void PerTabScrollingCheckBox_CheckedChanged(object sender, EventArgs e)
{
//RadTabStrip1.PerTabScrolling = ((CheckBox)sender).Checked;
//RadTabStrip1.ScrollPosition = 0;
}
public class TabTemplate : ITemplate
{
public void InstantiateIn(Control container)
{
Label label1 = new Label();
label1.ID = "ItemLabel";
label1.Text = (container as RadTab).Text;
container.Controls.Add(label1);
ImageButton imgRemove = new ImageButton();
imgRemove.Init += imgRemove_Init;
imgRemove.ID = "ImageButton1";
imgRemove.Width = Unit.Pixel(9);
imgRemove.Height = Unit.Pixel(9);
imgRemove.ImageUrl = "~/cut.png";
container.Controls.Add(imgRemove);
}
void imgRemove_Init(object sender, EventArgs e)
{
ImageButton img = (ImageButton)sender;
img.Click += imgRemove_Click;
}
void imgRemove_Click(object sender, ImageClickEventArgs e)
{
ImageButton img = (ImageButton)sender;
RadTab tab = img.Parent as RadTab;
tab.TabStrip.SelectedIndex = tab.Index - 1;
tab.TabStrip.Tabs.Remove(tab);
}
}
protected void ReorderTabsOnSelectCheckBox_CheckedChanged(object sender, EventArgs e)
{
}
}
0
Hello Suresh,
I was able to replicate the described issue, base on the provided code snippet and steps to reproduce. The bug is already forwarded to our developer team for further consideration. Thank you for pointing that out. We will do our best, in order to fix the issue as soon as possible.
Regards,
Nencho
Telerik
I was able to replicate the described issue, base on the provided code snippet and steps to reproduce. The bug is already forwarded to our developer team for further consideration. Thank you for pointing that out. We will do our best, in order to fix the issue as soon as possible.
Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
0
![](/forums/images/avatarimages/default.gif)
Suresh
Top achievements
Rank 1
answered on 10 Dec 2013, 01:48 PM
hi ,
Any solution found to above problem.reply fast
Any solution found to above problem.reply fast
0
Hello Suresh,
I am afraid that the issue has not been fixed yet. I would suggest you to track our release history for the fix release or I can simply update this thread, once the fix is available.
Regards,
Nencho
Telerik
I am afraid that the issue has not been fixed yet. I would suggest you to track our release history for the fix release or I can simply update this thread, once the fix is available.
Regards,
Nencho
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.