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: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Object in Tag property being cloned

Thread ID:





6900 Sep 4,2003 02:57 AM UTC Oct 10,2003 09:19 AM UTC WinForms 3
Tags: GridControl
Sue Harris
Asked On September 4, 2003 02:57 AM UTC

Hi, I've got a GridControl, and I store an object in the row header tags. One of my objects that I store implements ICloneable, and for some reason, this object seems to be getting cloned. Is there any way to prevent this? I want to be able to do a ReferenceEquals on the tag object, but can't as the Tag object is a clone of my original. I store the object in the tag like so: this.gridControl1[i+1,0].Tag = cloneClass; And I retrieve it: CloneClass c = this.gridControl1[row,0].Tag as CloneClass; Am I doing something wrong? I can provide a really simple example of this problem if it helps. Thanks, Sue

Administrator [Syncfusion]
Replied On September 4, 2003 07:01 AM UTC

If your tag object class implements ICloneable, then it will get cloned when setting style objects. This is by design. If you don't want it cloned, then you will have to wrap your tag object in a class that does not implement ICloneable.

Michael Barnes
Replied On October 10, 2003 03:58 AM UTC

This "cloneing" effect also occurs to anything you set as a CellValue. In this case I think that is not a good design decision - if I assign something as the CellValue, then I expect to get that same thing back when I ask for it later! Furthermore, if this is the behaviour, then it damn well ought to be documented as such - its pretty critical if you are using references to large objects as CellValues, and they are getting cloned behind your back!

Administrator [Syncfusion]
Replied On October 10, 2003 09:19 AM UTC

We will add a IsCloneable property in the StyleInfoProperty class which lets you specify application-wide if the property should support calling Clone when the value is ICloneable. Sorry for the inconvinience. Stefan


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

Live Chat Icon For mobile
Live Chat Icon