RADDropDownListElement不包含定义“所有者”

时间:2015-04-14 08:13:16

标签: c# winforms telerik

我使用VS2013和Telerik WinControls.UI \ v4.0_2015.1.331.40。 我想编译我的应用程序。我收到以下错误消息: RADDropDownListElement不包含定义'所有者'...

这个组件改变了什么?我该如何解决这个问题?

代码是:

void SVDropDownList_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Delete)
            {
                if (sender is RadDropDownListElement && (sender as RadDropDownListElement).Owner is RadDropDownList)
                {
                    /* Alleen SelectedValue op null zetten werkt niet altijd */
                    ClearItem();
                    //((sender as RadDropDownListElement).Owner as RadDropDownList).SelectedValue = null;
                }
            }
            else if (e.Control && e.KeyCode == Keys.C)
            {
                if (sender is RadDropDownListElement && (sender as RadDropDownListElement).Owner is RadDropDownList)
                {
                    string text = ((sender as RadDropDownListElement).Owner as RadDropDownList).Text;

                    if (!string.IsNullOrEmpty(text))
                        Clipboard.SetText(text);
                }
            }
        }

1 个答案:

答案 0 :(得分:1)

以下是访问控件的方法:

(sender as RadDropDownListElement).ElementTree.Control