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.
Unfortunately, activation email could not send to your email. Please try again.

Object in Tag property being cloned

Thread ID:

Created:

Updated:

Platform:

Replies:

6900 Sep 3,2003 10:57 PM Oct 10,2003 05:19 AM Windows Forms 3
loading
Tags: GridControl
Sue Harris
Asked On September 3, 2003 10:57 PM

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 03:01 AM

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 9, 2003 11:58 PM

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 05:19 AM

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

CONFIRMATION

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.

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.

;