Current location: Hot Scripts Forums » Programming Languages » ASP.NET » Dropdown list Last value


Dropdown list Last value

Reply
  #1 (permalink)  
Old 09-06-05, 03:53 AM
aish's Avatar
aish aish is offline
Newbie Coder
 
Join Date: Mar 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Dropdown list Last value

I fill dropdown lists values from the database then I wants to hard code first value and last value. I already hard code first value it's like this.

cboName.Items.Insert(0,new ListItem("----Select----","0"));

how can I hard code last value of the dropdown list, I want to add last value as a ----Other----. can anyone help me?
Thanks.
Reply With Quote
  #2 (permalink)  
Old 09-06-05, 03:35 PM
koncept
Guest
 
Posts: n/a
use cboName.Items.Count to get the number of items then just change the code around a bit from where you set the first one
Reply With Quote
  #3 (permalink)  
Old 09-07-05, 12:58 AM
aish's Avatar
aish aish is offline
Newbie Coder
 
Join Date: Mar 2005
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
Thanks for your Reply!
Reply With Quote
  #4 (permalink)  
Old 01-06-06, 04:23 PM
janove janove is offline
Newbie Coder
 
Join Date: Jan 2006
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
For Each..

U can allso try inserting the first value before a Fore-Each loop, or do while, and after the loop inserting the last value..
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I populate a dropdown list???? zorrox02 JavaScript 4 10-01-04 04:03 AM
Calling MYSQL table & list entrys in dropdown menu doublee313 PHP 1 09-25-04 04:29 AM
Select list dropdown button color jimcart CSS 1 03-28-04 12:45 AM
Execute javascript function based on selected dropdown list value. TKOEHN5751 JavaScript 2 03-14-04 12:13 AM
I need Help with Dropdown list knightjt02 PHP 3 10-30-03 03:10 AM


All times are GMT -5. The time now is 01:07 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.