473,320 Members | 1,933 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,320 software developers and data experts.

Adding List Item Value

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
3 1227
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: R.G. Vervoort | last post by:
Not sure if it is a php question but since i am working in php here it is. Ho can i add items to (the item label=visual text and the value=index number) a list object on a website. I am having...
3
by: daveland | last post by:
I am working on some JavaScript that dynamically adds rows to a table in response to a button click. A new row does appear on the screen when the button is clicked. However, that table to which a...
0
by: Andrew | last post by:
If item is a ListViewItem and str is a string, why do the following two lines not have the same effect ? item.SubItems.Add(new ListViewItem.ListViewSubItem()).Text = str;...
2
by: Shiju Poyilil | last post by:
Hi ! I have a requirement wherein i am binding a datalist which contains a label (Caption for the field) and some literal hidden fields and a dropdown list. When I am binding to the datalist.....
1
by: Brian Conklin | last post by:
Hello Eneryone, I am having a problem. I have written a little app that will take a text "pipe" delimited file and place all of the values in to an Excel spreadsheet. It works great on any of my...
0
by: Adam J. Schaff | last post by:
Hello. I have a custom collection that implements IBindingList (allownew and allowremove are both true). I have bound it to a datagrid. I have add and remove buttons on the screen. I want to...
15
by: glenn | last post by:
Hi folks, I have a DropDownList in a DataGrid that is populated from records in a database. I want to add a value that might be a string such as "Select a Company" for the first item since an...
1
by: The Eclectic Electric | last post by:
I'd be very grateful if anyone could help me with this. From my limited knowledge of Javascript I don't think it is possible, but I'll punt anyway. I downloaded and very slightly adapted this...
1
by: libish | last post by:
can we add a value to a list item?? i got a list with some list members here can we add a value to that list item??? ie. suppose a list contains items like "item1" "item2" "item3" etc...
1
by: cleary1981 | last post by:
Hi, I am trying to add page numbers to my document in xsl fo. I can get the page numbers to work but I need them to show at the bottom of each page. I know you can define an area as region-after...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
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: 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: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.