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. Image for the cookie policy date
close icon

Unable to add BarItem to Toolbar. Error "Attempted to store an element of the incorrect type into the array."

I'm getting an error (Header: Microsoft Development Environment, Message: Attempted to store an element of the incorrect type into the array.) which is preventing me from adding a BarItem to a ParentBarItem's Items collection.

When I add the BarItem to the list of Members in the BarItem Collection Editor, it appears and I can modify its properties, but when I press OK, I get the message again.

The app is Windows Forms, C# 1.1 (using VS2003), the toolbar is added to a control.

(Google can only find an MS KnowledgeBase doc which talks about controls being created in VS2003 and editted in VS2002, which clearly isn't the problem here).

1 Reply

PR Purusothaman R Syncfusion Team November 29, 2006 04:27 AM UTC

Hi Gary,

Which version of Syncfusion you are using for your application? Do you have more than one version of Essential Suite installed on your machine?

The exception mentioned by you, may occur during the transition from old versions to new versions. This can be solved easily by referencing the correct version of assemblies.

1. Uninstall all the earlier versions of Syncfusion.

2.Open the Assembly Manager tool choosing "Prebuilt Release" option. The Assembly Manager tool can be accessed from Start Menu >> Programs >> Syncfusion >> Essential Suite x.x >> Assembly Manager. First remove all versions using Assembly Manager and install the assemblies again. This will copy the Syncfusion Assemblies to GAC and PublicAssemblies.

3. Open up your project in the designer and delete all Syncfusion references. Re-add the references from the directory C:\Program Files\Microsoft Visual Studio .NET 2003\Common7\IDE\PublicAssemblies\

4. Make sure the "CopyLocal" property for the Syncfusion references is set to false in the designer

5. Now rebuild your application, and let me know how it goes.

Thanks for using Syncfusion Products.

Regards,
Purusothaman.R

Loader.
Live Chat Icon For mobile
Up arrow icon