Question

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 { }
}
Was it helpful?

Solution 2

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();
        }

OTHER TIPS

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);
     }
 }
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top