Click here to Skip to main content
15,910,981 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello,
I have dropdown for display name..
when i click on dropdown and typing starting letter of the name, then dropdownlist must show names only which start with letter what i typed..
"for example..when click on dropdownlist and type 'm' word, list of name started with 'm' will show.
Does anyone know how to do this?

What I have tried:

<asp:TableRow>
                    <asp:TableCell>
                        <asp:Label ID="lbl_approve" runat="server" Text="APPROVAL BY :"></asp:Label></asp:TableCell><asp:TableCell>
                            <asp:DropDownList ID="dd_approve" runat="server" Width="300px"  >
                            </asp:DropDownList>
                        </asp:TableCell></asp:TableRow
Posted
Updated 19-Feb-17 19:53pm
Comments
Graeme_Grant 19-Feb-17 23:25pm    
This question was asked HERE[^]. Are you the same person using a different account?

Where have you looked exactly for how the asp:DropDownList works?
Member 12938297 19-Feb-17 23:32pm    
no sir..iam new user...
i am designing webform..
Graeme_Grant 20-Feb-17 0:00am    
Where have you looked exactly for how the asp:DropDownList works?
Member 12938297 20-Feb-17 0:04am    
at the backend i used...
protected void loadapprove()
{
string connectionString = ConfigurationManager.ConnectionStrings["ConnectionISG_Trainee"].ConnectionString;
using (OracleConnection connection = new OracleConnection())
{
connection.ConnectionString = connectionString;
connection.Open();
Console.WriteLine("State: {0}", connection.State);
Console.WriteLine("ConnectionString: {0}", connection.ConnectionString);
OracleCommand command1 = connection.CreateCommand();

string staff = "select per_empcode, per_empname||'-'||per_empcode staffno from adm.edbdpersonnel order by per_empname";

OracleDataAdapter adap1 = new OracleDataAdapter(staff, connection);

DataTable ds1 = new DataTable();

adap1.Fill(ds1);
dd_approve.DataSource = ds1;
dd_approve.DataTextField = "staffno";
dd_approve.DataValueField = "per_empcode";
dd_approve.DataBind();
dd_approve.Items.Insert(0, new ListItem("--Select--", ""));




connection.Close();
}
}
this code works....but since i have 300 name list , it is difficult to select the name..
Graeme_Grant 20-Feb-17 0:11am    
Click the Reply button when continuing a thread.

It sounds like you want to dynamically update the dropdown. This will require some javascript. Google is your friend. There are tons of examples for you: dynamic search aps.net combobox[^]
 
Share this answer
 
 
Share this answer
 
Here is another suggestion. You should Google it too just like other member suggested.

Autocomplete | jQuery UI[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900