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

I can''t bind two columns to the same field?!

Thread ID:





67851 Aug 31,2007 10:16 PM UTC Sep 4,2007 01:38 AM UTC WinForms 1
Tags: Grouping
Asked On August 31, 2007 10:16 PM UTC

I was trying to bind two columns to the same field of my data source and got an error: "Item has already been added. Key in dictionary: 'XXXXAutoSizeMaxLength' Key being added: 'XXXXAutoSizeMaxLength'. XXXX being the name of the field.

What's going on?

Rajagopal [Syncfusion]
Replied On September 4, 2007 01:38 AM UTC

Hi Stanley,

Thanks for your interest in Syncfusion Products.

The reason for this error is because you are trying to add a column that already exists in the TableDescriptor.Columns collection. That is, when you add the column to the TableDescriptor.Columns collection whose mapping name is same as the one in the columns collection. The default behvior in the latest version is to populate the column collection from the datasource and add any new entry to the end of the collection. When you bind two columns of same name to a field, this would result in this exception. Whereas, in older versions before you add anything to the collection, Columns.Clear() will be called internally. To avoid this error, you need to explicitly call the Clear() method before you add columns to the existing collection with same name.

Let me know if you have any other questions.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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