By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,168 Members | 2,598 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,168 IT Pros & Developers. It's quick & easy.

Mulitselect listbox

P: n/a
How can i get the itemdata form each item in a mulitselect list.

I made a loop but keep getting only the first value.

Dim i

Dim array1(100)

For i = 1 To aantalrecords

If ListBox1.GetSelected(i - 1).ToString = True Then

ListBox1.SelectedIndex = i - 1

mylist = ListBox1.SelectedItem

array1(i) = mylist.ItemData

End If

Next

can someone please help me out?

Eric
Nov 20 '05 #1
Share this Question
Share on Google+
13 Replies


P: n/a
* "Eric Schreiber" <es**@cistron.nl> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
Cor
Hi Eric,

You think you made a loop but you did not,
You have to loop through the items from your listbox

Beneath some examples, roughly written so watch errors

I hope this helps?

Cor

something as for a winform
\\\
dim myarray(listbox1.selecteditems) as string
dim i as integer
for i = 0 to listbox1.selecteditems.count - 1
myarray(i) = listbox1.selecteditems(i).text
next
///
and for a webform
dim myarray(listbox1.items) as string
dim i as integer
for i = 0 to listbox1.items.count - 1
if listbox1.Items(i).selected then
myarray(i) = listbox1.selecteditems(i).text
end if
next
///
I hope this helps?

Cor

How can i get the itemdata form each item in a mulitselect list.

I made a loop but keep getting only the first value.

Dim i

Dim array1(100)

For i = 1 To aantalrecords

If ListBox1.GetSelected(i - 1).ToString = True Then

ListBox1.SelectedIndex = i - 1

mylist = ListBox1.SelectedItem

array1(i) = mylist.ItemData

End If

Next

can someone please help me out?

Eric

Nov 20 '05 #3

P: n/a
Cor
Hi Herfried,
* "Eric Schreiber" <es**@cistron.nl> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.


Have a look at this links

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

This is the worst quoting what you do here, using words from a message

I have seen this more from you quoting and deleting the essential things
from a message.

Cor
Nov 20 '05 #4

P: n/a
Cor
Hi Herfried,

I forgot to write, not angry only to help of course

:-)

Cor
Nov 20 '05 #5

P: n/a
"Cor" <no*@non.com> schrieb
This is the worst quoting what you do here, using words from a
message

I have seen this more from you quoting and deleting the essential
things from a message.

He doesn't have to quote everything. The question is sufficient. Apart from
this, you should better complain about those 500:1 lines quotes and sending
the quote again and again and again and again and again....must I continue?

:-(
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #6

P: n/a
Cor
Hi Armin,

He doesn't have to quote everything. Text from one of the first rows from one by you always needless sended extra
rows

On the other hand, the quotation should not be so short that it is unclear
to what the author is referring to, or so that it may even appear in a
totally different light.
The question is sufficient.
Who are you that you can say that, I think it is not. (you see think)
Apart from this, you should better complain about those 500:1 lines quotes and sending the quote again and again and again and again and again....must I

continue?

I am me not aware that I do that, but when I do please point me on that.

Cor

Nov 20 '05 #7

P: n/a
"Cor" <no*@non.com> schrieb

He doesn't have to quote everything.

Text from one of the first rows from one by you always needless
sended extra rows

On the other hand, the quotation should not be so short that it is
unclear to what the author is referring to, or so that it may even
appear in a totally different light.


Herfried's answer referred to the question. Why should he quote the code
also?
The question is sufficient.


Who are you that you can say that, I think it is not. (you see
think)


The question is not "who" I am. The question is if it's right or not. He
didn't refer to the code, so it's not necessary to quote it. Consequently it
is sufficient to quote the question. That's what remains and that's the
logical explanation, independent from "who" writes it.

Apart from this, you should better complain about those 500:1 lines
quotes

and
sending the quote again and again and again and again and
again....must I

continue?

I am me not aware that I do that, but when I do please point me on
that.


I think you misunderstood. I did not say you *do* complain, I said you do
*not* complain.
--
Armin

Nov 20 '05 #8

P: n/a
Cor
Armin,
Herfried's answer referred to the question. Why should he quote the code
also?
There is not spoken about an itemdata property in the question.

If Herfried had quoted right than his answer was maybe right but still not
correct.
including the quoting it had minimal to be.

------------------How can i get the itemdata form each item in a mulitselect list. ...................array1(i) = mylist.ItemData


There is no 'ItemData' property in VB.NET.
-------------------

Cor
Nov 20 '05 #9

P: n/a
"Cor" <no*@non.com> schrieb
Herfried's answer referred to the question. Why should he quote the
code also?


There is not spoken about an itemdata property in the question.

If Herfried had quoted right than his answer was maybe right but
still not correct.
including the quoting it had minimal to be.


If you want the full text, read the initial message.

EOT for me. :-)
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #10

P: n/a
* "Armin Zingler" <az*******@freenet.de> scripsit:
I have seen this more from you quoting and deleting the essential
things from a message.


He doesn't have to quote everything. The question is sufficient. Apart from
this, you should better complain about those 500:1 lines quotes and sending
the quote again and again and again and again and again....must I continue?


Yes, please... Make a 100,000 line quote...

;-)

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #11

P: n/a
* "Cor" <no*@non.com> scripsit:
Herfried's answer referred to the question. Why should he quote the code
also?


There is not spoken about an itemdata property in the question.


Are /you/ sure, you read the question?!

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #12

P: n/a
* "Cor" <no*@non.com> scripsit:
How can i get the itemdata form each item in a mulitselect list.


There is no 'ItemData' property in VB.NET.


Have a look at this links

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

This is the worst quoting what you do here, using words from a message


What's the problem? I only quoted things I referred to in the reply.

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13

P: n/a
Responding to message:
news:bu************@ID-208219.news.uni-berlin.de

We're not going to start this argument up again are we?
Nov 20 '05 #14

This discussion thread is closed

Replies have been disabled for this discussion.