editable dropdown list in web applications

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • gurukishore
    New Member
    • Oct 2007
    • 2

    editable dropdown list in web applications

    i want editable dropdown list in c#.net 2003..

    any body help me..
    its urgent


    guru
  • gurukishore
    New Member
    • Oct 2007
    • 2

    #2
    editable combobox in windows application

    editable combo box is there r not in windows application in vs.net 2001

    if it is there means give me the solution...



    urgent

    Comment

    • Frinavale
      Recognized Expert Expert
      • Oct 2006
      • 9749

      #3
      What do you mean by "editable DropDownList"?
      How is the user going to be able to edit it?

      It sounds like you're going to want to create/develop/implement a user control that is based on a DropDownList that allows the user to edit the contents of the DropDownList.

      -Frinny

      Comment

      • pooja g
        New Member
        • Oct 2007
        • 2

        #4
        u can use textbox and dropdown list to make editable dropdown list
        [code=asp]
        <asp:DropDownLi st ID="dropdown" runat="server" Font-Bold="True" Style="z-index: 100;

        left: 222px; position: absolute; top: 341px" Width="239px" Height="23px" Enabled="False" AutoPostBack="T rue" OnSelectedIndex Changed="ddlHan dlerRouteName_S electedIndexCha nged">
        <asp:ListItem >----New Item?----</asp:ListItem>

        <asp:ListItem>H ello</asp:ListItem>

        <asp:ListItem>W orld</asp:ListItem>

        </asp:DropDownLis t>
        [/code]
        ----------------------------------------------------------

        whn user click on new item show textbox and hide drop down and when he write new item in textbox then add tht item in drop down and make it visible
        [code=cpp]
        protected void dropdown_Select edIndexChanged( object sender, EventArgs e)
        {

        if (this.dropdownS electedIndex == 0)
        {

        this.textbox.Te xt = "";
        this.dropdown.V isible = false;

        this.textbox.Vi sible = true;
        }

        }

        protected voidtextbox_Tex tChanged(object sender, EventArgs e)
        {

        int index = 0;if(!this.drop down.Items.Cont ains(new ListItem(this.t extbox.Text.Tri m())))
        {

        this.dropdown.I tems.Add(this.t extbox.Text.Tri m());
        }

        for (int i = 0; i < this.dropdown.I tems.Count; i++)
        {

        if (dropdown.Items .Text == this.textbox.Te xt)
        {

        index = i;

        }

        }

        this.dropdown.S electedIndex = index;
        this.dropdown.V isible = true;

        this.textbox.Vi sible = false;
        }[/code]
        Last edited by Frinavale; Oct 29 '07, 01:44 PM. Reason: Added [code] tags to make more legible

        Comment

        Working...