Reputation: 339
If I select any item of a RadComboBox, next when I click on other parts of the page then the RadComboBox item is changing. How do I solve this problem?
aspx:
<telerik:RadComboBox ID="cmbExpCTC" runat="server" MarkFirstMatch="true">
</telerik:RadComboBox>
C#:
public void FillStatus()
{
try
{
cmbExpCTC.Enabled = true;
dsLocation = BizRegion.GetCandidateInterviewStatus(hfdcandidateid.Value, hfdjobid.Value, hfdRounds.Value);
RadComboBoxItem cItem = new RadComboBoxItem("Sourcing in process", "Sourcing");
cmbExpCTC.Items.Add(cItem);
if (dsLocation.Tables[0].Rows.Count > 0)
{
for (int i = 0; i <= dsLocation.Tables[0].Rows.Count - 1; i++)
{
cItem = new RadComboBoxItem(dsLocation.Tables[0].Rows[i]["InterviewFormat"].ToString() + " - " + "Round" + " " + dsLocation.Tables[0].Rows[i]["Rounds"].ToString(), "Sourcing");
cmbExpCTC.Items.Add(cItem);
}
}
}
catch { }
}
Upvotes: 0
Views: 1209
Reputation: 11
Your solution would clear the list so if the user click on the dropdown again, they won't have anything. All you have to do is:
OnClientDropDownClosed="OnComboBoxDropDownClosed"
function OnComboBoxDropDownClosed(sender, args) {
var field = $find('<%=cboBox.ClientID %>');
if (field !== null)
{
var text = cboBox.get_selectedItem().get_text();
field.set_text(text);
}
}
Upvotes: 1
Reputation: 339
I got solution, i added OnClientDropDownClosed javascript function to RadComboBox.
<telerik:RadComboBox ID="cmbExpCTC" runat="server" MarkFirstMatch="true" EnableLoadOnDemand="true" OnClientDropDownClosed="OncmbExpCTCDropDownClosed" >
</telerik:RadComboBox>
function OncmbExpCTCDropDownClosed(sender, args) {
sender.clearItems();
if (args.get_domEvent().stopPropagation)
args.get_domEvent().stopPropagation();
}
Upvotes: 0