473,325 Members | 2,805 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,325 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
Nov 13 '05 #1
1 6062
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

Nov 13 '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: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.