Inherit Tree View property problem!
-
i am creating a databound treeview but i am having trouble with my properties. I created a collection to hold the labels. and i added to the designer. I can create the labes, however, i do not know how can i save it; public class MyTreeColumns // this is my class containing the string label public class MyTreeColumnsCollection:CollectionBase // this is my collection of labels with methods for indexing, Add, Indexof, insert, remove, and contains. in the dataTreeView class I added: MyTreeColumnsCollection _objects = new MyTreeColumnsCollection(); [Browsable(true)] public MyTreeColumnsCollection TreeColumns { get { return _objects; } set { _objects = value; } } what i am missing? thank you drey:confused:
-
i am creating a databound treeview but i am having trouble with my properties. I created a collection to hold the labels. and i added to the designer. I can create the labes, however, i do not know how can i save it; public class MyTreeColumns // this is my class containing the string label public class MyTreeColumnsCollection:CollectionBase // this is my collection of labels with methods for indexing, Add, Indexof, insert, remove, and contains. in the dataTreeView class I added: MyTreeColumnsCollection _objects = new MyTreeColumnsCollection(); [Browsable(true)] public MyTreeColumnsCollection TreeColumns { get { return _objects; } set { _objects = value; } } what i am missing? thank you drey:confused:
I think you have to mark your classes as
[Serializable]
. Depending on your object structure you might have to implement theISerializable
andIDeserializationCallback
interfaces. (Like Hashtable does) /cadi 24 hours is not enough -
I think you have to mark your classes as
[Serializable]
. Depending on your object structure you might have to implement theISerializable
andIDeserializationCallback
interfaces. (Like Hashtable does) /cadi 24 hours is not enough