I'm trying to get the RadComboBox to work. We're using the RadControls 'Prometheus' for ASPNET Q3 2007 version: 2007.03.1314.20 from the Telerik.Web.UI.dll.; I believe this version is for AJAX.
When the page appears, the combo box appears with the text containing the first row(as expected), but it seems to be disabled. Nothing happens when clicking the drop-down arrow, nor entering text into the combobox itself.
I have tested this exact code with an older version (RadControls fro ASP.NET Q3 2007: version 2.8.3.0 RadCombobox.Net2.dll; I believe this version is NOT for AJAX.) and it works perfectly. (The only difference is the removal of a RadScriptManager which was required for the Prometheus version.)
The goal is to implement the Load On Demand functionality - similar to the example here:
http://demos.telerik.com/aspnet-ajax/ComboBox/Examples/PopulatingWithData/AutoCompleteSql/DefaultCS.aspx
but the ItemsRequested event doesn't seem to fire when using the example given here:
http://www.telerik.com/help/aspnet-ajax/combo_loadondemandoverview.html
I have attached my code. Any help would be great.
Thanks.
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>Untitled Page</title> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <div> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <telerik:RadComboBox ID="comboContact" runat="server" > |
| </telerik:RadComboBox> |
| </div> |
| </form> |
| </body> |
| </html> |
| using System; |
| using System.Data; |
| using System.Configuration; |
| using System.Web; |
| using System.Web.Security; |
| using System.Web.UI; |
| using System.Web.UI.WebControls; |
| using System.Web.UI.WebControls.WebParts; |
| using System.Web.UI.HtmlControls; |
| using System.Data.SqlClient; |
| public partial class _Default : System.Web.UI.Page |
| { |
| protected void Page_Load(object sender, EventArgs e) |
| { |
| comboContact.DataSource = GetAllContacts(); |
| comboContact.DataValueField = "ContactID"; |
| comboContact.DataTextField = "FirstName"; |
| comboContact.DataBind(); |
| } |
| private DataSet GetAllContacts() |
| { |
| DataSet retVal = null; |
| try |
| { |
| using (SqlConnection conn = new SqlConnection(ConfigurationManager.ConnectionStrings["mainConnectionString"].ConnectionString)) |
| { |
| SqlDataAdapter da = new SqlDataAdapter("SELECT * FROM Contact ORDER BY FirstName", conn); |
| DataSet ds = new DataSet(); |
| da.Fill(ds); |
| retVal = ds; |
| } |
| } |
| catch (SqlException ex) |
| { |
| } |
| return retVal; |
| } |
| } |