473,405 Members | 2,404 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,405 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 4355
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.