"choose one" in a dropdownlist

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Cirene

    "choose one" in a dropdownlist

    I have a databound drop down list. What is the easiest way to put the 1st
    item as "choose one"?

    Thanks.


  • Geek

    #2
    Re: "choose one" in a dropdownlist

    On Jun 4, 4:47 pm, "Cirene" <cir...@nowhere .comwrote:
    I have a databound drop down list.  What is the easiest way to put the 1st
    item as "choose one"?
    >
    Thanks.
    if u did not complete it yet.set the selectedindex property to the 1.

    Comment

    • Mark Rae [MVP]

      #3
      Re: &quot;choose one&quot; in a dropdownlist

      "Cirene" <cirene@nowhere .comwrote in message
      news:uIcuHjjxIH A.4912@TK2MSFTN GP03.phx.gbl...
      >I have a databound drop down list. What is the easiest way to put the 1st
      >item as "choose one"?
      MyDDL.Items.Ins ert(0, new ListItem("Choos e one", ""));


      --
      Mark Rae
      ASP.NET MVP


      Comment

      • Eliyahu Goldin

        #4
        Re: &quot;choose one&quot; in a dropdownlist

        <asp:dropdownli st ... AppendDataBound Items="true" ..>
        <asp:ListItem Text="choose one" Value="-1" />
        </asp:dropdownlis t>

        --
        Eliyahu Goldin,
        Software Developer
        Microsoft MVP [ASP.NET]




        "Cirene" <cirene@nowhere .comwrote in message
        news:uIcuHjjxIH A.4912@TK2MSFTN GP03.phx.gbl...
        >I have a databound drop down list. What is the easiest way to put the 1st
        >item as "choose one"?
        >
        Thanks.
        >

        Comment

        • xzzy

          #5
          Re: &quot;choose one&quot; in a dropdownlist

          another possibility is in sql server, something like

          select field01, field02 from tablename union '<< Chose One>>' as aa, -1 as
          bb from tablename

          and then .bind in codebehind etc.

          John Bickmore

          "Cirene" <cirene@nowhere .comwrote in message
          news:uIcuHjjxIH A.4912@TK2MSFTN GP03.phx.gbl...
          >I have a databound drop down list. What is the easiest way to put the 1st
          >item as "choose one"?
          >
          Thanks.
          >

          Comment

          • Cirene

            #6
            Re: &quot;choose one&quot; in a dropdownlist

            thanks everyone !

            all great advice!

            "xzzy" <mrbikejoc1@com cast.netwrote in message
            news:BOWdnabYP8 QsO9vVnZ2dnUVZ_ qPinZ2d@comcast .com...
            another possibility is in sql server, something like
            >
            select field01, field02 from tablename union '<< Chose One>>' as aa, -1 as
            bb from tablename
            >
            and then .bind in codebehind etc.
            >
            John Bickmore

            "Cirene" <cirene@nowhere .comwrote in message
            news:uIcuHjjxIH A.4912@TK2MSFTN GP03.phx.gbl...
            >>I have a databound drop down list. What is the easiest way to put the 1st
            >>item as "choose one"?
            >>
            >Thanks.
            >>
            >
            >

            Comment

            Working...