cancel
Showing results for 
Search instead for 
Did you mean: 

Adding tab in tabstrip control dynamically..........

Former Member
0 Kudos

Hi ,

I am using TabStrip control of PDK .NET. I want to add tab dynamically in tabstrip control.

But I am getting error for any postback when I switch in between tabs.

Error description is :

<b>"Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"</b>

<b>Stack Trace:

[ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.

Parameter name: index]

System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) +2382545

SAP.Web.UI.Controls.TabCollection.get_Item(Int32 index) +6

SAP.Web.UI.Controls.TabStrip.LoadPostData(String sPostData, NameValueCollection oPostCollection) +92

System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +674

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2965</b>

Any help appreciated?

Regards,

Prashant

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Has anyone got a solution for this? I am doing the exact same thing, and having the exact same error....how do we persist the viewstate of the dynamically created tabstrip? I have already set EnableViewState to true.

Former Member
0 Kudos

Hi Prashant,,

your index is less than zero, the postback will not store it unless you explicitly save it using 'enable view state' for the tree control, if it is already enabled and still not working: here is the work around :-

you can store it in a hidden input field, so that it can be retrived when you do a postback, and then reassign the current index

it should be a relatively simple fix

please let me know how you get along...

with respect,

amit

Former Member
0 Kudos

Hello,

I'm having exactly the same problem. EnableViewstate is True but it still dosn't work.

How would I assign the viewstate to a hidden control and then retrieve it?

Any help greatly appriciated.