RadComboBox changing selected item when clicking on other parts of page

帅比萌擦擦* 提交于 2019-12-13 05:17:41

问题


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 { }
}

回答1:


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


来源:https://stackoverflow.com/questions/22934701/radcombobox-changing-selected-item-when-clicking-on-other-parts-of-page

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!