Filling DropDownList Box


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Filling DropDownList Box

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Posts
    17

    Question Filling DropDownList Box

    Guys,

    Can you guys tell me how to fill the dropdown list box programatically with code in asp.net(vb.net)

    Thanks,

  2. #2
    Join Date
    Dec 2005
    Location
    Arrr
    Posts
    32
    You need to use the Items Collection's add method like so:
    (assuming your dropdown list is ddl1,


    ddl1.Items.Add("Item 1")
    ddl1.Items.Add("Item 2")
    ddl1.Items.Add("Item 3")

  3. #3
    Join Date
    Nov 2005
    Location
    Jaipur
    Posts
    14
    if u want to add items with their values then use

    ddl1.Items.Add(new ListItems("Item 1","value1"))
    ddl1.Items.Add(new ListItems("Item 2","value2"))
    ddl1.Items.Add(new ListItems("Item 3","value3"))
    thanks
    raj

Similar Threads

  1. Filling Combo box using ADO
    By Shravan in forum VB Classic
    Replies: 1
    Last Post: 12-28-2002, 09:48 AM
  2. DropDownList box
    By Balu in forum ASP.NET
    Replies: 1
    Last Post: 11-14-2002, 01:49 PM
  3. Replies: 1
    Last Post: 08-06-2002, 02:29 AM
  4. fomatting in dropdownlist box
    By Hari Reddy in forum ASP.NET
    Replies: 1
    Last Post: 04-21-2002, 10:51 PM
  5. Filling in text Box With Combo Select
    By Jason in forum VB Classic
    Replies: 1
    Last Post: 02-21-2002, 11:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center