Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. databinding a dropdown list in asp.net and c#

databinding a dropdown list in asp.net and c#

Scheduled Pinned Locked Moved ASP.NET
csharpasp-netdatabasejson
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gbabu17
    wrote on last edited by
    #1

    hi, i have a dropdown list which should be databound to a database table. Thats is fine, but i want to have first 2 entries of the list to be static and the rest from database table...like list values : choose one.... All the rest from database table. to achieve this what to do in the asp.net page and in the c# page. thanks

    T S 2 Replies Last reply
    0
    • G gbabu17

      hi, i have a dropdown list which should be databound to a database table. Thats is fine, but i want to have first 2 entries of the list to be static and the rest from database table...like list values : choose one.... All the rest from database table. to achieve this what to do in the asp.net page and in the c# page. thanks

      T Offline
      T Offline
      ToddHileHoffer
      wrote on last edited by
      #2

      You can add the values to sql statement using a union statment. Or after the databind insert a listitem object into the dropdownlist.

      how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

      G 1 Reply Last reply
      0
      • G gbabu17

        hi, i have a dropdown list which should be databound to a database table. Thats is fine, but i want to have first 2 entries of the list to be static and the rest from database table...like list values : choose one.... All the rest from database table. to achieve this what to do in the asp.net page and in the c# page. thanks

        S Offline
        S Offline
        Sidonath
        wrote on last edited by
        #3

        Set "AppendDataBoundItems" property of DropDownList to "true" and all databound items will be added after items you've added manually. e.g. Please choose one _________________

        G 1 Reply Last reply
        0
        • T ToddHileHoffer

          You can add the values to sql statement using a union statment. Or after the databind insert a listitem object into the dropdownlist.

          how vital enterprise application are for proactive organizations leveraging collective synergy to think outside the box and formulate their key objectives into a win-win game plan with a quality-driven approach that focuses on empowering key players to drive-up their core competencies and increase expectations with an all-around initiative to drive up the bottom-line. But of course, that's all a "high level" overview of things --thedailywtf 3/21/06

          G Offline
          G Offline
          gbabu17
          wrote on last edited by
          #4

          thanks

          1 Reply Last reply
          0
          • S Sidonath

            Set "AppendDataBoundItems" property of DropDownList to "true" and all databound items will be added after items you've added manually. e.g. Please choose one _________________

            G Offline
            G Offline
            gbabu17
            wrote on last edited by
            #5

            sidonath,i think asp.net1.1 dropdownlist control does not have the AppendDataBoundItems property.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups