Home Search Member List Faq Register Login  
UltimateTabstrip
Re: Cloning Tabs

Thread Starter: tmeschede   Started: 01-24-2012 10:28 AM   Replies: 3
 Karamasoft Support Forums » General Discussions » UltimateTabstrip » Re: Cloning Tabs
 Printable Version    « Previous Thread   Next Thread »
  24 Jan 2012, 10:28 AM
tmeschede is not online. Last active: 10/30/2014 1:36:02 PM tmeschede

Top 10 Posts
Joined on 10-22-2008
Chicago, IL
Posts 16
Cloning Tabs
I have been trying to clone a tab using the following code:

Dim a As Karamasoft.WebControls.UltimateTabstrip.Tab = CType(Me.utsProcessViewer.Tabs.Item(0).Clone, Karamasoft.WebControls.UltimateTabstrip.Tab)

a.ID = "tabDocument1"
a.HeaderText = "Document 1"
a.Visible = True

utsProcessViewer.Tabs.Add(a)

Code is working, but it will not render the the tab strip control.  Below is the error I am getting:

 

Server Error in '/' Application.

Object reference not set to an instance of an object.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NullReferenceException: Object reference not set to an instance of an object.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.] Karamasoft.WebControls.UltimateTabstrip.Tab.i(HtmlTextWriter A_0) +175 Karamasoft.WebControls.UltimateTabstrip.UltimateTabstrip.RenderTabContents(HtmlTextWriter writer) +259 Karamasoft.WebControls.UltimateTabstrip.UltimateTabstrip.RenderAnyPath(HtmlTextWriter writer) +152 Karamasoft.WebControls.UltimateTabstrip.UltimateTabstrip.RenderUpLevelPath(HtmlTextWriter writer) +13 Karamasoft.WebControls.UltimateTabstrip.UltimateTabstrip.Render(HtmlTextWriter writer) +39 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163 System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32 System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40 System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134 System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19 System.Web.UI.Page.Render(HtmlTextWriter writer) +29 System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27 System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99 System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266 


Version Information: Microsoft .NET Framework Version:2.0.50727.3625; ASP.NET Version:2.0.50727.3634

Have any ideas why it will not render when I am cloning another tab?

Tom


  
  24 Jan 2012, 10:39 AM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Cloning Tabs
Wheer exactly do you have this code? In the Page_Load event handler? Please make sure that Me.utsProcessViewer.Tabs.Items is not null or its count is not zero. The error message looks like you trying to access the property of a null object.
  
  24 Jan 2012, 11:37 AM
tmeschede is not online. Last active: 10/30/2014 1:36:02 PM tmeschede

Top 10 Posts
Joined on 10-22-2008
Chicago, IL
Posts 16
Re: Cloning Tabs
Yes .. I am running the code in the Page_Load event.

No ... The item is not null .. It actually references the correct tab I am trying to clone.  It even adds it to the tab collection.

The error is occuring when it trys to render the control in the browser for some reason.

So, it seems the cloning method is working.  The control just will not display.

Tom

  
  24 Jan 2012, 12:51 PM
Karamasoft is not online. Last active: 11/10/2017 3:24:14 PM Karamasoft

Top 10 Posts
Joined on 09-05-2004
Posts 6,818
Re: Cloning Tabs
The Clone method does not clone the ContentTemplate property of the Tab control, therefore the control will not be rendered properly. As we pointed out in your other Forums post, the ContentTemplate property cannot be set dynamically.
  
 Page 1 of 1 (4 items)
Karamasoft Support Forums » General Discussions » UltimateTabstrip » Re: Cloning Tabs

You can add attachments
You can post new topics
You can reply to topics
You can delete your posts
You can edit your posts
You can create polls
You can vote in polls
Forum statistics are enabled
Forum is unmoderated

© 2002-2018 Karamasoft LLC. All rights reserved.