473,396 Members | 1,757 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Collection property

I want to implement a collection property inside another (in a control
derived class) but I have some persistence problems.

There is an example of my ColumnItem class

<TypeConverter(GetType(ColumnItemConverter))> _

Public Class ColumnItem

Private m_strText As String

Private m_intWidth As Integer

Private m_imgImage As Image

Private m_colValueItems As ValueItemsCollection

Public Sub New()

'...

End Sub

Public Property Text() As String

Get

Return m_strText

End Get

Set(ByVal Value As String)

m_strText = Value

End Set

End Property

Public Property Width() As Integer

Get

Return m_intWidth

End Get

Set(ByVal Value As Integer)

m_intWidth = Value

End Set

End Property

<Editor(GetType(CollectionEditor), GetType(UITypeEditor)), _

DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)> _

Public ReadOnly Property ValueItems() As ValueItemsCollection

Get

Return m_colValueItems

End Get

End Property

'... other properties

End Class
I have a CollectionBase derived class object that contains all my
columnitems.
ValueItemsCollection is another CollectionBase derived class for my
sub-collection.
When I enter new columns in design time, nothing is serialized in the
InitializeComponent of the form.

Does anybody could send me some tips about how to do that?

Thanks
Jul 19 '05 #1
1 4353
You probably need to add InstanceDescriptors for your collection contents.
Read this and it should get you pointed in the right direction:
http://www.msdn.microsoft.com/librar.../en-us/dndotne
t/html/custcodegen.asp?frame=true

--

Please do not reply to this alias directly. This posting is provided "AS
IS" with no warranties, and confers no rights. You assume all risk for your
use. © 2002 Microsoft Corporation. All rights reserved.
"Marc L'Ecuyer" <ml******@chca.ca> wrote in message
news:Ob**************@TK2MSFTNGP11.phx.gbl...
I want to implement a collection property inside another (in a control
derived class) but I have some persistence problems.

There is an example of my ColumnItem class

<TypeConverter(GetType(ColumnItemConverter))> _

Public Class ColumnItem

Private m_strText As String

Private m_intWidth As Integer

Private m_imgImage As Image

Private m_colValueItems As ValueItemsCollection

Public Sub New()

'...

End Sub

Public Property Text() As String

Get

Return m_strText

End Get

Set(ByVal Value As String)

m_strText = Value

End Set

End Property

Public Property Width() As Integer

Get

Return m_intWidth

End Get

Set(ByVal Value As Integer)

m_intWidth = Value

End Set

End Property

<Editor(GetType(CollectionEditor), GetType(UITypeEditor)), _

DesignerSerializationVisibility(DesignerSerializat ionVisibility.Content)> _
Public ReadOnly Property ValueItems() As ValueItemsCollection

Get

Return m_colValueItems

End Get

End Property

'... other properties

End Class
I have a CollectionBase derived class object that contains all my
columnitems.
ValueItemsCollection is another CollectionBase derived class for my
sub-collection.
When I enter new columns in design time, nothing is serialized in the
InitializeComponent of the form.

Does anybody could send me some tips about how to do that?

Thanks

Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Kurt Bauer | last post by:
I have an ASP group calendar application which pulls calendar data from Exchange via webdav into an XML string. I then loop the XML nodes to populate a collection of appointments. Finally I use...
24
by: downwitch | last post by:
Hi, I know this has been covered here and in the .public groups, but it seems like it's been a while, especially around here, so I just thought I'd ask again to see if anyone has figured out a...
2
by: Brian | last post by:
NOTE ALSO POSTED IN microsoft.public.dotnet.framework.aspnet.buildingcontrols I have solved most of my Server Control Collection property issues. I wrote an HTML page that describes all of the...
2
by: S. Justin Gengo | last post by:
Hi, I've created a component that allows me to store database information for various types of databases my company uses. It uses a collection for each type of database. Everything is working...
10
by: Chet Cromer | last post by:
I am creating a set of base classes and sub classes to use throughout a program I'm developing. The base class represents a generic "lookup table" from my database that contains lists of things...
3
by: Thief_ | last post by:
I want to store data pertaining to a widget in a collection. The widget has many pproperties, so i created the following class and called it "clsWatchProperties": Public Class clsWatchProperties...
4
by: Michael | last post by:
Dear all .. If I want to use develop a user control and declare a public property which the type is System.Windows.Forms.GridTableStylesCollection For example : Public Class LookAndView...
14
by: Rich | last post by:
Yes, I need to store some values in an array type collection object that can hold 3 or more parameters per index. I have looked at the collection object, hashtable object and would prefer not to...
6
by: Arthur Dent | last post by:
How do you sort a generic collection derived from System.Collections.ObjectModel.Collection? Thanks in advance, - Arthur Dent
6
by: Erick | last post by:
I've created a class called Procs and a collection class called Processes which uses a hastable object to store the Procs. Now i want to enumerate with the "For each" to extract all the Procs in...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.