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

Adding List Item Value

P: n/a
I know I have seen this somewhere but I can't seem to
find it. I would like to add the list item value along
with my list item text. So far I have this:

Listbox1.Items.Insert("0", "All")

How do I add a value for "All"?

Thanks.
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
Listbox1.Items.Insert(0,New ListItem("Text","Value"))

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
"jason" <an*******@discussions.microsoft.com> wrote in message
news:05****************************@phx.gbl...
I know I have seen this somewhere but I can't seem to
find it. I would like to add the list item value along
with my list item text. So far I have this:

Listbox1.Items.Insert("0", "All")

How do I add a value for "All"?

Thanks.

Nov 19 '05 #2

P: n/a
Dim item as new ListItem("All", "Some Value")
ListBox1.Items.Insert(0, item)

Note the Insert takes an integer not a string as the first parameter.

-Brock
DevelopMentor
http://staff.develop.com/ballen
I know I have seen this somewhere but I can't seem to find it. I
would like to add the list item value along with my list item text.
So far I have this:

Listbox1.Items.Insert("0", "All")

How do I add a value for "All"?

Thanks.


Nov 19 '05 #3

P: n/a
thanks!
-----Original Message-----
Listbox1.Items.Insert(0,New ListItem("Text","Value"))

--
Teemu Keiski
ASP.NET MVP, AspInsider
Finland, EU
"jason" <an*******@discussions.microsoft.com> wrote in messagenews:05****************************@phx.gbl...
I know I have seen this somewhere but I can't seem to
find it. I would like to add the list item value along
with my list item text. So far I have this:

Listbox1.Items.Insert("0", "All")

How do I add a value for "All"?

Thanks.

.

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.