Wrox Programmer Forums
|
BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5
This is the forum to discuss the Wrox book Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter Kit by David Sussman, Alex Homer; ISBN: 9780764588075
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 9th, 2007, 12:38 AM
Registered User
 
Join Date: Feb 2007
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Editable Dropdown list in ASP.NET

I Have a requirement in which i need to display some values in a dropdown list so that the user can select a value from it and also the dropdown list must allow the user to type a new value inside the dropdown list,
Right now i am binding this dropdown list to a SQL Table column and able to display the values and the user is able to select a value from the list but i am not able edit the dropdown list , I tried using custom controls but it didnt work, can anyone help me out with this ? Thanks in advance

 
Old February 9th, 2007, 07:01 AM
Authorized User
 
Join Date: Jan 2006
Posts: 19
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You will have to use a combo-box style ASP.NET custom control, or build your own equivalent. An example is at http://www.daveandal.net/books/6744/combobox/combo.aspx and http://www.daveandal.net/books/6744/...opulating.aspx, but there are plenty you can get from places such as http://www.asp.net.
 
Old October 24th, 2007, 02:20 PM
Registered User
 
Join Date: Oct 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

u can use textbox and dropdown list to make editable dropdown list

<asp:DropDownList ID="dropdown" runat="server" Font-Bold="True" Style="z-index: 100;

left: 222px; position: absolute; top: 341px" Width="239px" Height="23px" Enabled="False" AutoPostBack="True" OnSelectedIndexChanged="ddlHandlerRouteName_Select edIndexChanged">
<asp:ListItem>----New Item?----</asp:ListItem>

<asp:ListItem>Hello</asp:ListItem>

<asp:ListItem>World</asp:ListItem>

</asp:DropDownList>

----------------------------------------------------------->>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>

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

protected void dropdown_SelectedIndexChanged(object sender, EventArgs e)
{

if (this.dropdownSelectedIndex == 0)
{

this.textbox.Text = "";
this.dropdown.Visible = false;

this.textbox.Visible = true;
}

}

protected voidtextbox_TextChanged(object sender, EventArgs e)
{

int index = 0;if(!this.dropdown.Items.Contains(new ListItem(this.textbox.Text.Trim())))
{

this.dropdown.Items.Add(this.textbox.Text.Trim());
}

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

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

index = i;

}

}

this.dropdown.SelectedIndex = index;
this.dropdown.Visible = true;

this.textbox.Visible = false;
}


 
Old July 19th, 2008, 07:14 PM
Registered User
 
Join Date: Jul 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Maybe you can try the code for COMBOBOX in HTML. It is an Editable DropDown Listbox with any one select option as Editable (like a textbox ) and the rest as readonly. You can find it here:

http://chakrabarty.com/pp_editable_dropdown.html

http://chakrabarty.com/combobox.html
 
Old February 17th, 2011, 02:28 PM
Authorized User
 
Join Date: Apr 2005
Posts: 49
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by alexhomer View Post
You will have to use a combo-box style ASP.NET custom control, or build your own equivalent. An example is at http://www.daveandal.net/books/6744/combobox/combo.aspx and http://www.daveandal.net/books/6744/...opulating.aspx, but there are plenty you can get from places such as http://www.asp.net.


LINKS DEAD AS OF 2-17-11
 
Old February 17th, 2011, 09:43 PM
jminatel's Avatar
Wrox Staff
Points: 18,059, Level: 58
Points: 18,059, Level: 58 Points: 18,059, Level: 58 Points: 18,059, Level: 58
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Posts: 1,906
Thanks: 62
Thanked 139 Times in 101 Posts
Default

Dave and Al's site has moved, and no longer supports runnable samples. However, all of the book resources (code, errata, etc.) are still available to download.

The page containing links to all of them is http://www.daveandal.net/books/misc/default.htm.
__________________
Jim Minatel
Associate Publisher, WROX - A Wiley Brand
Did someone here help you? Click on their post!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Editable dropdown list kotaiah Java GUI 2 July 19th, 2008 07:32 PM
Sorting XML data in a dropdown list on asp.net Hughesie78 XML 4 November 27th, 2007 11:50 AM
Pass value from dropdown list to another ASP SQL Thamil Classic ASP Databases 19 August 29th, 2006 11:37 AM
Pass value from dropdown list to another ASP SQL Thamil BOOK: Professional Crystal Reports for VS.NET 0 August 25th, 2006 04:18 AM
Issue with dropdown list and submit - ASP.NET Montenegro ASP.NET 1.0 and 1.1 Basics 0 March 24th, 2004 04:40 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.