Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old February 8th, 2007, 11:38 PM
Registered User
 
Join Date: Feb 2007
Location: , , .
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

  #2 (permalink)  
Old February 9th, 2007, 06:01 AM
Authorized User
 
Join Date: Jan 2006
Location: , , .
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.
  #3 (permalink)  
Old October 24th, 2007, 02:20 PM
Registered User
 
Join Date: Oct 2007
Location: , , .
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;
}


  #4 (permalink)  
Old July 19th, 2008, 07:14 PM
Registered User
 
Join Date: Jul 2008
Location: , , .
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
  #5 (permalink)  
Old February 17th, 2011, 01:28 PM
Authorized User
Points: 209, Level: 4
Points: 209, Level: 4 Points: 209, Level: 4 Points: 209, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2005
Location: , , .
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
  #6 (permalink)  
Old February 17th, 2011, 08:43 PM
jminatel's Avatar
Wrox Staff
Points: 17,437, Level: 57
Points: 17,437, Level: 57 Points: 17,437, Level: 57 Points: 17,437, Level: 57
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2003
Location: Indianapolis, IN, USA.
Posts: 1,933
Thanks: 57
Thanked 128 Times in 97 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
Blog: http://p2p.wrox.com/content/blogs/jminatel
Wrox on Twitter: http://twitter.com/wrox
Did someone here help you? Click on their post!
 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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 10: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 03:40 PM



All times are GMT -4. The time now is 01:15 PM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.