How AuotCompltedBox postbax and get the selected item id on server side

2 posts, 0 answers
  1. Rahul
    Rahul avatar
    39 posts
    Member since:
    Jan 2014

    Posted 29 Jan 2014 Link to this post

       I want to do when i selected AutoCompleteBox  item i want to do a postback and get the selected items id on server provide solutions.
  2. Boyan Dimitrov
    Boyan Dimitrov avatar
    1968 posts

    Posted 31 Jan 2014 Link to this post

    Hello Rahul,

    Please use the RadAutoCompleteBox EntryAdded server-side event and enable by setting AutoPostBack property to "True"
    //markup code
    <telerik:RadAutoCompleteBox ID="RadAutoCompleteBox1" runat="server" DataSourceID="SqlDataSource1" DataTextField="ContactName" DataValueField="CustomerID" AutoPostBack="true" OnEntryAdded="RadAutoCompleteBox1_EntryAdded">
            <asp:SqlDataSource runat="server" ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnString %>"
           ProviderName="System.Data.SqlClient" SelectCommand="SELECT [CustomerID], [ContactName] FROM [Customers] ORDER By ContactName">

    //code behind
    protected void RadAutoCompleteBox1_EntryAdded(object sender, AutoCompleteEntryEventArgs e)
           AutoCompleteBoxEntry entry = e.Entry;
           //you can access the entry text
           String entryText = entry.Text;

    Boyan Dimitrov
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Back to Top