|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Items propertywhy 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-- "guy" <g**@discussions.microsoft.com> schrieb BindingList: "Search found no results"> 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? System.Windows.Forms.BindingsCollection.Item, if you mean that, is public. Armin 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 Show quoteHide quote "Armin Zingler" wrote: > "guy" <g**@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 > 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... -- Show quoteHide quoteHope this helps Jay [MVP - Outlook] ..NET Application Architect, Enthusiast, & Evangelist T.S. Bradley - http://www.tsbradley.net "guy" <g**@discussions.microsoft.com> wrote in message news:86B7B2DD-BA38-4C89-A9C5-E8CF6A276F3E@microsoft.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" <g**@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 | > sorry Armin i should have made it clear, i am using vb2005, and it is the
System.ComponentModel.BindingList that i am refering to Show quoteHide quote "Armin Zingler" wrote: > "guy" <g**@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 >
Show quote
Hide quote
"guy" <g**@discussions.microsoft.com> schrieb It's also not found in VB 2005.> > > "guy" <g**@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 .....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 thanks Armin - i only found it via google - not MSDN!
lol guy Show quoteHide quote "Armin Zingler" wrote: > "guy" <g**@discussions.microsoft.com> schrieb > > > > > "guy" <g**@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 > > Armin,
Did you try this one already? http://lab.msdn.microsoft.com/search/?query=ComponentModel.BindingList+ All compactframework as far as I saw. Cor "Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> schrieb I would have found it on my own, but my time is also limited.> Armin, > > Did you try this one already? > > http://lab.msdn.microsoft.com/search/?query=ComponentModel.BindingList+ > > All compactframework as far as I saw. Thx anyway. :-) Armin F1 in VS2005 SUCKS! (most of the time).
Show quoteHide quote "Armin Zingler" <az.nospam@freenet.de> wrote in message news:%23MwRG9vNGHA.2624@TK2MSFTNGP12.phx.gbl... > "guy" <g**@discussions.microsoft.com> schrieb >> >> > "guy" <g**@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
switch form sqlserver to access at runtime
Address parameter in WebClient.UploadFile? Program flow control Current Recordset does not support updating - HELP needed! Which Database type to use? Unable to open file remotely Simple Binding with Textbox Control mshflexgrid Problem system.runtime.interopservices.COMException Countdown Timer |
|||||||||||||||||||||||