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

GridGroupingControl - Engine InitializeFrom Error

Hi,

We are using v 4.2.0.37.

We are saving the grid settings using "WriteXmlSchema()" method. Later, we are applying the SAVED grid settings along with some other column additions/removals on grid.

While we are applying the SAVED grid settings, we are creating a temporary engine object using "GridEngine.CreateFromXml()", making changes to the temporary engine TableDescriptor.Columns and TableDescriptor.VisibleColumns collections. (We can't avoid this temp engine and column collections updating.) And then we are Initializing the grid control with this temporary grid engine.

But the line gridGroupingControl.Engine.InitializeFrom(tempEngine); is some times throwing the error like {"Item has already been added. Key in dictionary: '' Key being added: 'COLUMN NAME'"}.

So, I guess, some kind of cleaning up is required on gridGroupingControl.Engine before/while Initializing.

Do we need to call any other method/set properties for Initializing?

Can you plz look into this?

Rgds
Rajani Kanth

2 Replies

AD Administrator Syncfusion Team January 3, 2007 05:13 AM UTC

Hi Rajani,

Before intialize the Engine, you need to clear the Bounded columns in a grid by calling the TableDescriptor.Columns.Clear() method. Here is a code snippet

this.gridGroupingControl1.Engine.TableDescriptor.Columns.Clear() ;

Best Regards,
Haneef


BR Badri Rajani Kanth January 4, 2007 12:22 PM UTC

Excellent! Working fine.

Thank You Very Much Haneef.

Rgds
Rajani Kanth

Loader.
Live Chat Icon For mobile
Up arrow icon