New to Telerik UI for ASP.NET AJAX? Download free 30-day trial

On the Server

The following case scenario gives an insight into the AutoCompleteBoxEntry collection when working with the selected entries of RadAutoCompleteBox on the server.

<telerik:RadButton RenderMode="Lightweight" runat="server" ID="RadButton1" OnClick="RadButton1_Click" Text="Get selected entries" />

<asp:Label runat="server" ID="Label1" />

<telerik:RadAutoCompleteBox RenderMode="Lightweight" ID="RadAutoCompleteBox1" runat="server" AllowCustomEntry="true"
    InputType="Token" Delimiter=";" DataSourceID="SqlDataSource1" DataTextField="Name"

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
    SelectCommand="SELECT [ID], [NAME] FROM [Cities]"></asp:SqlDataSource>  

protected void RadAutoCompleteBox1_EntryAdded(object sender, AutoCompleteEntryEventArgs e)
    Label1.Text = e.Entry.Text + " was added.";

Protected Sub RadButton1_Click(sender As Object, e As EventArgs)
    For Each entry As AutoCompleteBoxEntry In RadAutoCompleteBox1.Entries
        Label1.Text += entry.Text + ": " + entry.Value + ", "
End Sub

See Also

In this article
Not finding the help you need? Improve this article