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

Programmatic Binding

This example demonstrates how to bind programatically RadComboBox in load on demand scenario. Also when user types it in the input field a callback is made to the server in order to request all customer names that match the typed text.

protected void RadComboBox2_ItemsRequested(object o, RadComboBoxItemsRequestedEventArgs e)
            using (NorthwindReadOnlyDataContext northwindEntities = new NorthwindReadOnlyDataContext())
                var allCustomers = northwindEntities.Customers.
                    OrderBy(i => i.ContactName);

                if (!String.IsNullOrEmpty(e.Text))
                    allCustomers = northwindEntities.Customers.Where(i =>
                      .OrderBy(i => i.ContactName);

				var customers = allCustomers.Skip(e.NumberOfItems).Take(10);
				RadComboBox2.DataSource = customers;

				int endOffset = e.NumberOfItems + customers.Count();
				int totalCount = allCustomers.Count();

				if (endOffset == totalCount)
					e.EndOfItems = true;

				e.Message = String.Format("Items 1-{0} out of {1}",
					endOffset, totalCount);
  • DefaultVB.aspx
  • DefaultVB.aspx.vb
  • styles.css
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="DefaultVB.aspx.vb" Inherits="ComboBox.Examples.PopulatingWithData.EntityDataSource.DefaultVB" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>

<!DOCTYPE html>
<html xmlns=''>
<head runat="server">
    <title>Telerik ASP.NET Example</title>

    <form id="form1" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" ShowChooser="true" />

    <div class="demo-container size-thin">
        <telerik:RadComboBox RenderMode="Lightweight" runat="server" ID="RadComboBox2" DataTextField="ContactName" 
            EnableLoadOnDemand="True" OnItemsRequested="RadComboBox2_ItemsRequested" Height="200px" Width="300"


Support & Learning Resources

Find Assistance