Michael,
In VB 2005: Rather then inheriting directly from
System.Collections.Generics.List(Of T) I would recommend inheriting from
System.Collections.ObjectModel.Collection(Of T).
In VB 2002 & 2003: I would use CollectionBase as ECathell suggests.
As Collection(Of T) is the Generics replacement for CollectionBase, while
KeyedCollection(Of K, T) is the Generics "replacement" for DictionaryBase.
http://blogs.msdn.com/kcwalina/archi...llections.aspx http://blogs.msdn.com/kcwalina/archi...26/474010.aspx
--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley -
http://www.tsbradley.net
"Michael Fällgreen" <mf*@ulle.se> wrote in message
news:uu****************@tk2msftngp13.phx.gbl...
| Hi,
|
| I need to make a strongly typed collection of x, and the simplets way is
to
| inherits list(of x). With that I can bind to a list-control. However - i
| don't need all the methods from list(of x).
|
| If I make a private list as list(of x) in a class and implements IList(of
x)
| I can control what methods to be public. I works - but now I can't bind
the
| collection to a listbox og grid (it says something about complex
datatype).
|
| What is the right way of doing a strongly typed collection (that can bind
to
| a ui control)?
|
|
|
|