473,325 Members | 2,308 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.

Items property

guy
why is it that some collection classes, eg BindingList, but others as well do
not expose their Items property? It is there as a Protected property so why
not make it public?

I can work around this but there must be a design reason for this, what is it?

--guy--
Feb 21 '06 #1
10 1458
"guy" <gu*@discussions.microsoft.com> schrieb
why is it that some collection classes, eg BindingList, but others
as well do not expose their Items property? It is there as a
Protected property so why not make it public?

I can work around this but there must be a design reason for this,
what is it?

BindingList: "Search found no results"

System.Windows.Forms.BindingsCollection.Item, if you mean that, is public.
Armin
Feb 21 '06 #2
guy
Hi Armin,
my thought was that you cant do a

For Each thing as Object in myBindingList.Items

you have to do something like

For i=1 to myBindingList.Count
thing=myBindingList.Item(i)

i just wondered why it was designed this way

cheers

guy

"Armin Zingler" wrote:
"guy" <gu*@discussions.microsoft.com> schrieb
why is it that some collection classes, eg BindingList, but others
as well do not expose their Items property? It is there as a
Protected property so why not make it public?

I can work around this but there must be a design reason for this,
what is it?

BindingList: "Search found no results"

System.Windows.Forms.BindingsCollection.Item, if you mean that, is public.
Armin

Feb 21 '06 #3
guy
sorry Armin i should have made it clear, i am using vb2005, and it is the
System.ComponentModel.BindingList that i am refering to

"Armin Zingler" wrote:
"guy" <gu*@discussions.microsoft.com> schrieb
why is it that some collection classes, eg BindingList, but others
as well do not expose their Items property? It is there as a
Protected property so why not make it public?

I can work around this but there must be a design reason for this,
what is it?

BindingList: "Search found no results"

System.Windows.Forms.BindingsCollection.Item, if you mean that, is public.
Armin

Feb 21 '06 #4
"guy" <gu*@discussions.microsoft.com> schrieb
"guy" <gu*@discussions.microsoft.com> schrieb
why is it that some collection classes, eg BindingList, but
others as well do not expose their Items property? It is there
as a
Protected property so why not make it public?

I can work around this but there must be a design reason for
this, what is it?

BindingList: "Search found no results"

System.Windows.Forms.BindingsCollection.Item, if you mean that, is
public.


sorry Armin i should have made it clear, i am using vb2005, and it
is the System.ComponentModel.BindingList that i am refering to

It's also not found in VB 2005.

.....later....

I had to enter "bindglist(of t)" in order to find it. What a new nonsense.
:-((((( When I press F1 then, the topic is not found. I love it.

Sorry, I can not help you.
Armin

Feb 21 '06 #5
guy
thanks Armin - i only found it via google - not MSDN!

lol

guy

"Armin Zingler" wrote:
"guy" <gu*@discussions.microsoft.com> schrieb
"guy" <gu*@discussions.microsoft.com> schrieb
> why is it that some collection classes, eg BindingList, but
> others as well do not expose their Items property? It is there
> as a
> Protected property so why not make it public?
>
> I can work around this but there must be a design reason for
> this, what is it?
BindingList: "Search found no results"

System.Windows.Forms.BindingsCollection.Item, if you mean that, is
public.


sorry Armin i should have made it clear, i am using vb2005, and it
is the System.ComponentModel.BindingList that i am refering to

It's also not found in VB 2005.

.....later....

I had to enter "bindglist(of t)" in order to find it. What a new nonsense.
:-((((( When I press F1 then, the topic is not found. I love it.

Sorry, I can not help you.
Armin

Feb 21 '06 #6
Armin,

Did you try this one already?

http://lab.msdn.microsoft.com/search...l.BindingList+

All compactframework as far as I saw.

Cor
Feb 21 '06 #7
"Cor Ligthert [MVP]" <no************@planet.nl> schrieb
Armin,

Did you try this one already?

http://lab.msdn.microsoft.com/search...l.BindingList+

All compactframework as far as I saw.

I would have found it on my own, but my time is also limited.

Thx anyway. :-)


Armin
Feb 21 '06 #9
CMM
F1 in VS2005 SUCKS! (most of the time).

--
-C. Moya
www.cmoya.com
"Armin Zingler" <az*******@freenet.de> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
"guy" <gu*@discussions.microsoft.com> schrieb
> "guy" <gu*@discussions.microsoft.com> schrieb
> > why is it that some collection classes, eg BindingList, but
> > others as well do not expose their Items property? It is there
> > as a
> > Protected property so why not make it public?
> >
> > I can work around this but there must be a design reason for
> > this, what is it?
>
>
> BindingList: "Search found no results"
>
> System.Windows.Forms.BindingsCollection.Item, if you mean that, is
> public.


sorry Armin i should have made it clear, i am using vb2005, and it
is the System.ComponentModel.BindingList that i am refering to

It's also not found in VB 2005.

....later....

I had to enter "bindglist(of t)" in order to find it. What a new
nonsense. :-((((( When I press F1 then, the topic is not found. I love it.

Sorry, I can not help you.
Armin

Feb 21 '06 #10
guy,
BindingList does not expose an Items collection as BindingList itself is the
"items" collection.

Instead of:

| For Each thing as Object in myBindingList.Items

Use:

For Each thing as Object in myBindingList

FWIW: If you have a type that has an "Items" collection that suggests that
you have a type that *has* a collection. Classes such as BindingList (that
have a Count & Item properties, GetEnumerator method) *are* a collection.
Generally For Each requires that the type implement IEnumerable or
IEnumerable(Of T). However For Each can operate on types that have a
GetEnumerator method without implementing either interface... Unfortunately
I don't have the link handy on the specifics of what For Each looks for...

--
Hope this helps
Jay [MVP - Outlook]
..NET Application Architect, Enthusiast, & Evangelist
T.S. Bradley - http://www.tsbradley.net
"guy" <gu*@discussions.microsoft.com> wrote in message
news:86**********************************@microsof t.com...
| Hi Armin,
| my thought was that you cant do a
|
| For Each thing as Object in myBindingList.Items
|
| you have to do something like
|
| For i=1 to myBindingList.Count
| thing=myBindingList.Item(i)
|
| i just wondered why it was designed this way
|
| cheers
|
| guy
|
| "Armin Zingler" wrote:
|
| > "guy" <gu*@discussions.microsoft.com> schrieb
| > > why is it that some collection classes, eg BindingList, but others
| > > as well do not expose their Items property? It is there as a
| > > Protected property so why not make it public?
| > >
| > > I can work around this but there must be a design reason for this,
| > > what is it?
| >
| >
| > BindingList: "Search found no results"
| >
| > System.Windows.Forms.BindingsCollection.Item, if you mean that, is
public.
| >
| >
| > Armin
| >
Feb 22 '06 #11

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

Similar topics

0
by: Dennis | last post by:
I have been needing a tag property for some of my list box items and I've seen this question in this news group before where one solution was to define a usercontrol inheiriting from the list box. ...
0
by: Dennis | last post by:
I have been needing a tag property for some of my list box items and I've seen this question in this news group before where one solution was to define a usercontrol inheiriting from the list box. ...
5
by: VB Newbie | last post by:
I am creating a user control containing a combobox using VB.NET(2003) I want to add 2 public properties "DataSource" and "Items" like the "System.Windows.Forms.ComboBox" here is my code, but it...
0
by: Saimeera | last post by:
Hi, I am creating a custom control in asp.net 2.0. I want to add items in the collection property when i set the value for a property name 'code' during design mode. I can able to add items...
3
by: Stuart | last post by:
I am using Visual Basic 2005. I have created a two dimensional ArrayList named aSystem that is populated as follows:- aSystem.Add(New PickList(0, "Undefined")) aSystem.Add(New PickList(-1,...
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...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
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.