We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Facing problems when i add tabs dynamically from code.

Thread ID:

Created:

Updated:

Platform:

Replies:

77307 Oct 24,2008 11:06 AM UTC Jul 8,2015 12:40 PM UTC ASP.NET Web Forms (Classic) 5
loading
Tags: Tools
Subramanya Bhat
Asked On October 24, 2008 11:06 AM UTC

HI,

I am having a requirement wherein i want to add the tabs based upon users selection dynamically thrugh code. I created a TABSTRIP with a default tab and a MULTIPAGE with a default page and gave a dropdown wherein user selects the value and click add tab button.

PROBLEM: When i click on the ADD TAB button first time the tab is getting created with the page but consequent clicks erases the old Pages.

heres my code

private bool CreateTab(string e)
{
if (!CartTabStrip.Items.Contains("Tab_"+ e))
{
TabStripItem TabItem = new TabStripItem();
TabItem.Text = e;
TabItem.ID = "Tab_" + e;
TabItem.PageViewID = "Page_" + e;
CartTabStrip.Items.Add(TabItem);
return true;
}
else
{
return false;
}
}


private void CreatePage(string e)
{
PageView TabPage = new PageView();
TabPage.ID = "Page_" + e;

TextBox text = new TextBox();
text.Text = e;

TabPage.Controls.Add(text);

CartTabs.Pages.Add(TabPage);
}


Rekha P [Syncfusion]
Replied On October 28, 2008 12:42 PM UTC

Hi Subbu,

Thank you for your interest in Syncfusion Products.

Please refer the below link for sample files which illustrates your requirement,
http://websamples.syncfusion.com/samples/Tools.Web/F77307-TabStrip.zip

Please let me know if this sample helps you.

Thanks,
Rekha


Subramanya Bhat
Replied On October 30, 2008 06:39 AM UTC

Thanks Rekha,

It helped.

But the problem is not solved fully.

1) This solution doesnt work if i put the menu control inside the Update Panel control to acheive Ajax Functionality.

2) What if the multipage is having a Gridgrouping control instead of textbox. How will you maintain the state of the existing controls.


Rekha P [Syncfusion]
Replied On November 1, 2008 09:16 AM UTC

Hi Subbu,

Thank you for being patient.

Regarding,
1) This solution doesnt work if i put the menu control inside the Update Panel control to acheive Ajax Functionality.
Please refer the below link for sample files which illustrates the working of Menu control inside the UpdatePanel,
http://websamples.syncfusion.com/samples/Tools.Web/F77307-Menu-Updatepanel.zip

2) What if the multipage is having a Gridgrouping control instead of textbox. How will you maintain the state of the existing controls.
Please refer the workaround sample containing a Gridgrouping control in PageView along with the video clip,
http://websamples.syncfusion.com/samples/Tools.Web/F77307-PageView-GGC.zip

Please let me know if you have any concerns.

Thanks,
Rekha


Ali Kaslan
Replied On July 6, 2015 09:11 AM UTC

Hi,
I m facing the same problem,
Old pages are lost when i add a new one.
How can i solve this problem

Thanks

Ezhil S [Syncfusion]
Replied On July 8, 2015 12:40 PM UTC

Hi Ali,

Thank you for contacting Syncfusion support.

We are unable to reproduce the issue reported that the pages are lost on adding newer pages from code behind. Kindly ensure whether you have provided unique ID for the PageView created dynamically. We have prepared a sample that allows you to add new TabItem integrated with new PageView created dynamically. Please check whether the issue reproduces in the shared sample. If not modify the sample to reproduce the issue at our end so that we can provide you an alternative solution.
Sample link: http://www.syncfusion.com/downloads/support/forum/77307/ze/Tab_add_773071899672768
Please let us know if you have any queries.

Regards,
Ezhil S

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;