Telerik ComboBox with AutoComplete Property

Telerik ComboBox with AutoComplete Property


Basically comboBox is combination of two control (Textbox and DropdownList).So its pretty easy to use functionality of both control in one .

Step 1: Design web form .aspx page

<div>
        <asp:ScriptManager ID="sm" runat="server">
        </asp:ScriptManager>
        <telerik:RadComboBox ID="RadComboBox1" runat="server" AllowCustomText="true" MarkFirstMatch="true"
            er DataTextField="CompanyName" DataValueField="CustomerID">
        </telerik:RadComboBox>
    </div>

Step 2:Code on .CS page

  protected void Page_Load(object sender, EventArgs e)
    {
        bind_combo();
    }
    public void bind_combo()
    {
        DataTable dt = new DataTable();
        dt.Columns.Add("Id", typeof(int));
        dt.Columns.Add("Name");

        dt.Rows.Add("1", "kandy");
        dt.Rows.Add("2", "sam");
        dt.Rows.Add("3", "raju");
        dt.Rows.Add("4", "kandy4");

        RadComboBox1.DataTextField = "Name";
        RadComboBox1.DataValueField = "Id";
        RadComboBox1.DataSource = dt;
        RadComboBox1.DataBind();
    }


It will look like :-

 



Comments

Popular posts from this blog

Create and save QR code in asp.net with C#

Change text of RadGrid Header Dynamically

Telerik Radwindow Open on Button Click