I want search the data in combobox .
i am using AutoCompleteMode="SuggestAppend" and DropDownStyle="Simple"
But I can't type any text in combo box
Please any one help me...
<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
<asp:ScriptManager ID="sp1" runat="server"></asp:ScriptManager>
<cc1:ComboBox ID="c1" runat="server" AutoCompleteMode="SuggestAppend" DropDownStyle="Simple"></cc1:ComboBox>
</asp:Content>
protected void Page_Load(object sender, EventArgs e)
{
if (IsPostBack == false)
{
bind_dg();
}
}
private void bind_dg()
{
string constr = ConfigurationManager.ConnectionStrings["connect"].ConnectionString;
string query = "select surgery_name from surgery_master order by surgery_name";
SqlCommand cmd = new SqlCommand(query);
using (SqlConnection con = new SqlConnection(constr))
{
using (SqlDataAdapter da = new SqlDataAdapter())
{
cmd.Connection = con;
da.SelectCommand = cmd;
using (DataTable dt = new DataTable())
{
da.Fill(dt);
if (dt.Rows.Count > 0)
{
for (int i = 0; i < dt.Rows.Count; i++)
{
c1.Items.Add(dt.Rows[i]["surgery_name"].ToString());
}
}
}
}
}
}