单击页面的其他部分时,RadComboBox更改选定的项目 [英] RadComboBox changing selected item when clicking on other parts of page

查看:170
本文介绍了单击页面的其他部分时,RadComboBox更改选定的项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我选择RadComboBox的任何一项,那么接下来,当我单击页面的其他部分时,RadComboBox的项就会发生变化.我该如何解决这个问题?

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

推荐答案

我找到了解决方案,我向RadComboBox添加了OnClientDropDownClosed javascript函数.

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

这篇关于单击页面的其他部分时,RadComboBox更改选定的项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆