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

Problems with inherited form with control RadTabStrip

1 Answer 140 Views
Tabstrip (obsolete as of Q2 2010)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
nomar2894
Top achievements
Rank 1
nomar2894 asked on 22 Aug 2007, 08:14 PM

Hi,

I have created the template form with the control RadTabStrip.  When the other form inherites from the template, I can’t add more TabItems in design time, because it fails. The errors are:

Element already added!
Hide    

at Telerik.WinControls.RadElementCollection.CheckElementAlreadyAdded(Object value)
at Telerik.WinControls.RadElementCollection.OnInsert(Int32 index, Object value)
at System.Collections.CollectionBase.System.Collections.IList.Insert(Int32 index, Object value)
at Telerik.WinControls.RadItemCollection.OnInsertComplete(Int32 index, Object value)
at System.Collections.CollectionBase.System.Collections.IList.Add(Object value)
at Telerik.WinControls.RadItemCollection.AddRange(RadItem[] value)

But if i comment the line

this.radTabStrip1.Items.AddRange(new Telerik.WinControls.RadItem[] {

this.tabItem2});

and change it for 

this.radTabStrip1.Items.AddRange(new Telerik.WinControls.RadItem[] {

 

new Telerik.WinControls.UI.TabItem()

});

there is no error. In run time it doesn´t  present this error.

1 Answer, 1 is accepted

Sort by
0
kdev
Top achievements
Rank 1
answered on 23 Aug 2007, 12:32 PM
Hi nomar2894,
I have the same problem and here is the Telerik answer:
"We are deeply sorry for this problem, KORT. Unfortunately, it relates to the way the VS2005 designer works, and we not sure how to overcome it.

There are several issues that all 3rd party component vendors, including Telerik, experience with their controls when working in inherited form designers. Actually, even some of the toolbox controls do not behave as expected in this case (eg. DataGridView will appear disabled and it is not possible to alter any of its properties).

It seems that the custom designers' behavior is somehow overridden in this case and we still haven't found any solution to this problem. We can only suggest a workaround by preparing a template form that you can copy in your project instead of inheriting it, especially if you use third party controls. Or you can inherit the form, but modify the collection properties (such as .Items) programmatically only, in the inherited form's initializer method.

You are not the first to report this issue and it has been logged in our system for quite some time. I guess the only way to go would be to contact Microsoft and check where the problem comes from. We will do our best to keep you updated on this issue.
Thank you in advance for your understanding.
Kind regards,
Mike
the Telerik team "

if some one have any alternative, please feel free to post a message
Thanks
Kort 
Tags
Tabstrip (obsolete as of Q2 2010)
Asked by
nomar2894
Top achievements
Rank 1
Answers by
kdev
Top achievements
Rank 1
Share this question
or