473,378 Members | 1,391 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Is it possible to create editable drop down list using ASP.NET?

Is it possible to create editable drop down list using ASP.NET?
Mar 25 '07 #1
2 23188
Yes it is, go to this site. he has a link to download the C# code.
http://weblogs.asp.net/coltk/archive/2003/09/17/27772.aspx
May 10 '07 #2
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;
}
Oct 24 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: jason | last post by:
Is there a way - possibly a disconnected rs? - to update the contents of an existing pulldown on a page without having to re-submit the page for the user to see the pulldown populated with an...
6
by: Filiz Duman | last post by:
I was just wondering, is it possible to write into the drop down box in order to jump to a specific item. The reason why I am asking is my drop down box has many items and additionally to the...
2
by: Arpan | last post by:
An ASP application retrieves the DISTINCT records from all the columns of a SQL Server DB table & populates them in drop-down lists. The no. of drop-down lists on the web page depends upon the no....
2
by: alien2_51 | last post by:
In the EditCommand event I've added a drop down list to the controls collection for the cell I want to edit. Dim objDDLBrake As New DropDownList objDDLBrake.CssClass = "label1" ...
2
by: zambizzi | last post by:
....I can't seem to get my hands on a control I'm loading in an editable datagrid. Here's my datagrid control: <asp:datagrid id="GLRulesGrid" runat="server" autogeneratecolumns="False"...
1
by: kafi | last post by:
Hi All; I am looking for an editable drop down control that can be used on a web page using ASP.NET. The reason I need an editable DDL is that on my web app. (using ASP.NET) I have a DDL that...
1
by: subhashk | last post by:
Is it possible to create a editable HTML drop down list using javascript?
3
by: anya | last post by:
Hi, I would like to have an editable DropDownList in my ruby on rails application. The user should be able to select a value from the list of choices, or type in a new value (in one of the empty...
2
by: Doug | last post by:
Hi, I can't figure out how to create a drop-down list box. The help file says it exists. The icon in the help file matches the combobox in the toolbox. I tried using a combox box, both with and...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.