void cboClient_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) { Facade.IReferenceData facReferenceData = new Facade.ReferenceData(); DataSet ds; DataTable dt; RadComboBoxItem rcItem; int itemsPerRequest = 20; int itemOffset; int endOffset; this.cboClient.Items.Clear(); if (this.IsCalledFromHotKey) { ds = facReferenceData.GetClientAndSubcontractorLookup(e.Text); } else if (this.IsClient) { ds = facReferenceData.GetAllClientsFiltered(e.Text); } else { ds = facReferenceData.GetAllSubContractorsFiltered(e.Text); } itemOffset = e.NumberOfItems; endOffset = itemOffset + itemsPerRequest; dt = ds.Tables[0]; dt.DefaultView.Sort = "OrganisationName"; dt.DefaultView.ApplyDefaultSort = true; if (endOffset > dt.Rows.Count) { endOffset = dt.Rows.Count; } for (int i = itemOffset; i < endOffset; i++) { rcItem = new RadComboBoxItem(); rcItem.Text = dt.Rows[i]["OrganisationName"].ToString(); rcItem.Value = dt.Rows[i]["IdentityID"].ToString(); cboClient.Items.Add(rcItem); } if (dt.Rows.Count > 0) { e.Message = string.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, dt.Rows.Count); } }