I have inherited from the previous developer, a large project that uses the Rad Classic .Net Controls.
I have installed the new Ajax .Net controls and I am trying to restore all functionality to the site.
I have changed the code that uses RadComboBox to use the new properties according to the documentation on doing this.
The code now compiles cleanly, but the ItemsRequested event is not firing, so the RadComboBox does not populate. Other events, such as Load and Init, do fire, just not ItemsRequsted.
I tried a simple example in a separate project and the RadComboBox works as expected. However, if I cut and paste the control from that project into my project, the event does not fire on it either.
I would consider using the web service interface instead, but I am having trouble getting that to work as well and that is a different story. For now, I would rather just use the existing code if I can get it to work and I am baffled why the event will not fire.
The code is below. The Load and Init events fire as expected. But when I type in the combobox, the ItemsRequested event does not.
This User Control (ASCX) is used by an ASPX file, which uses a master page, which puts a script manager onto the page... in case any of that matters.
In ASCX file: |
<rad:RadComboBox ID="RadComboBox2" |
EnableLoadOnDemand="true" |
Skin="Vista" |
Width="250px" |
runat="server" |
OnItemsRequested="RadComboBox2_ItemsRequested" |
oninit="RadComboBox2_Init" |
onload="RadComboBox2_Load"> |
</rad:RadComboBox> |
In CodeBehind: |
protected void RadComboBox2_ItemsRequested(object o, Telerik.Web.UI.RadComboBoxItemsRequestedEventArgs e) |
{ // Never gets here. |
for (int i = 1; i < 10; i++) |
{ |
RadComboBoxItem item = new RadComboBoxItem(); |
item.Text = "Item " + i.ToString() + " added from ItemsRequested event"; |
RadComboBox2.Items.Add(item); |
} |
} |
protected void RadComboBox2_Load(object sender, EventArgs e) |
{ |
// This event fires. |
} |
protected void RadComboBox2_Init(object sender, EventArgs e) |
{ |
// This event fires. |
} |
Any idea why the event won't fire?
Rick.