
Mohammed Rafiq
Top achievements
Rank 1
Mohammed Rafiq
asked on 21 Apr 2010, 08:36 AM
Hi,
I have a combobox added in a usercontrol. I am loading the user control dynamically in the page. I have registered the event selectedIndexChanged in the user control, but the event is not firing.
Below is the control added in user control.
I am then loading the usercontrol dynamically in the page in the page_load event.
But the event is not firing.
Thanks in Advance,
Afzal
I have a combobox added in a usercontrol. I am loading the user control dynamically in the page. I have registered the event selectedIndexChanged in the user control, but the event is not firing.
Below is the control added in user control.
<telerik:RadComboBox ID="rcbPlain" runat="server" CausesValidation="false" MaxLength="30" AutoPostBack="true" OnSelectedIndexChanged="rcbPlaint_SelectedIndexChaned"> |
</telerik:RadComboBox> |
I am then loading the usercontrol dynamically in the page in the page_load event.
But the event is not firing.
Thanks in Advance,
Afzal
6 Answers, 1 is accepted
0

Claus Pedersen
Top achievements
Rank 1
answered on 21 Apr 2010, 10:29 AM
I experience the same problem.
To make sure that the index changes.
I am trying to set the values of a series of cascaded Comboboxes from a saved state from the db.
Because the Comboboxes are cascaded, it is very important that the SelectedIndexChanged funtion is called between setting index in each combo.
The page is called with a saveset id and if not postback, then I load the saveset from the database and iterate through it.
It contains a series of ComboBoxIds/values in the correct order.
I set the new index like this:
curCombo.SelectedIndex = curCombo.FindItemIndexByValue(controlIdValue[1]); |
The first Combo index does change, because it's content is loaded before the above is called, but the next combo fails on "FindItemIndexByValue" because it is empty because the SelectedIndexChanged funtion of the previous combo, which is responsible of populating the next combo, isn't called.
Running Q1 SP1 .Net 4.0.
/Claus
0

Arunkumar Nagendra
Top achievements
Rank 1
answered on 21 Apr 2010, 11:02 AM
Does anybody know how to resolve this. I am facing the same issue. This is making me to pull my hairs off :-(
0
Hi guys,
I was not able to reproduce the problem with the dynamically loaded user control with combobox.
Find attached a sample project.
Sincerely yours,
Veskoni
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
I was not able to reproduce the problem with the dynamically loaded user control with combobox.
Find attached a sample project.
Sincerely yours,
Veskoni
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0

Bill Fogg
Top achievements
Rank 1
answered on 07 May 2010, 03:00 PM
I am having the same problem. Has anyone found a fix for this.
The difference between the last example and what I (and I think the others) are doing is using the load on demand feature.
The difference between the last example and what I (and I think the others) are doing is using the load on demand feature.
<telerik:RadComboBox ID="LicCertCb" runat="server" Height="200px" Width="200px" |
DropDownWidth="530px" EmptyMessage="Choose one" HighlightTemplatedItems="true" |
EnableLoadOnDemand="true" OnItemsRequested="LicCertCb_ItemsRequested" OnSelectedIndexChanged="LicCertCb_SelectedIndexChanged" AutoPostBack="true" > |
<HeaderTemplate> |
<table style="width: 500px" cellspacing="0" cellpadding="0"> |
<tr> |
<td style="width: 50px;"> |
Type |
</td> |
<td style="width: 100px;"> |
Number |
</td> |
<td style="width: 50px;"> |
State |
</td> |
<td style="width: 300px;"> |
Agency |
</td> |
</tr> |
</table> |
</HeaderTemplate> |
<ItemTemplate> |
<table style="width: 500px" cellspacing="0" cellpadding="0"> |
<tr valign="top"> |
<td style="width: 50px;"> |
<%# DataBinder.Eval(Container, "Attributes['Type']")%> |
</td> |
<td style="width: 100px;"> |
<%# DataBinder.Eval(Container, "Text")%> |
</td> |
<td style="width: 50px;"> |
<%# DataBinder.Eval(Container, "Attributes['State']")%> |
</td> |
<td style="width: 300px;"> |
<%# DataBinder.Eval(Container, "Attributes['Agency']")%> |
</td> |
</tr> |
</table> |
</ItemTemplate> |
</telerik:RadComboBox> |
The LicCertCb_ItemsRequested method is being called and populating the combo box but when I select one of the values it doesn't call the LicCertCb_SelectedIndexChanged method.
0

Bill Fogg
Top achievements
Rank 1
answered on 07 May 2010, 03:38 PM
Sorry, my fault.
The issue was that I had a validator on another element on the form and it was preventing the post-back from happening.
I modified it to use a validation group and everything is working now.
The issue was that I had a validator on another element on the form and it was preventing the post-back from happening.
I modified it to use a validation group and everything is working now.
0

Alec
Top achievements
Rank 1
answered on 28 Mar 2018, 02:25 PM
Thanks for posting this. I just ran into the same issue.