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

StaticData Class

I have created a custom cell type and one of the properties uses a class derived from ArrayList. Essential Grid uses a class called Static Data to store the properties of cells so I need to store my derived class in an instance of Static Data. Unfortunately it appears from Object Browser that Data Data can only return objects of System.Type.

When I do this:

Get
Return CType(GetValue MyCellStyleStore.StoredValues), DerivedArrayList)
End Get

I get a type conversion error. Everything looks right. The Static Data store contains the DerivedArrayList type but the GetValue is returning the ArrayList base class.

It is possible that this is by design and if so then it limits the value of Static Data I think.

BTW - I tried Syncfusion customer support but the person on the other end has no idea what I am asking. I hope someone here can help me. Thanks.


1 Reply

AD Administrator Syncfusion Team June 23, 2008 07:08 PM UTC

In order to get the casting to work, I think you will need to have your derived class implement ICloneable.

public class DerivedNumberList : ArrayList, ICloneable
{

#region ICloneable Members

object ICloneable.Clone()
{
DerivedNumberList list = new DerivedNumberList();
list.AddRange(this.ToArray());
return list;
}

#endregion

}



Loader.
Live Chat Icon For mobile
Up arrow icon