[英]ASP.NET C# How to re-establish EmptyMessage in Telerik RadComboBox in nested User Control?
I have the following scenario: 我有以下情况:
Here is the problem: 这是问题所在:
When I change the value to a smaller number, say from 3 to 1, and I have, for example, the value 2 already chosen in RadComboBox_grandchild, the list gets updated, and in the code_behind the values change correctly (as in selectedIndex is -1, selectedItem is null, etc.) BUT, I do not see "Please select", I still see the value "2", even though it is no longer on the list. 当我将值更改为较小的数字(例如,从3更改为1)时,例如,我已经在RadComboBox_grandchild中选择了值2,该列表将被更新,并且在code_behind中,值正确更改(如selectedIndex为- 1,selectedItem为null,等等。)但是,我不再看到“请选择”,尽管仍然不在列表中,但我仍然看到了值“ 2”。
How can I avoid this? 如何避免这种情况? How can I make it show the EmptyMessage "Please select" again?
如何使其再次显示EmptyMessage“请选择”? I tried the ClearSelection method, but it didn't do anything because it already is without a selection.
我尝试了ClearSelection方法,但是它没有做任何事情,因为它已经没有选择。 It seems to me that the mechanism used to persist the values from the previous postback is forcefully persisting a value that no longer exists.
在我看来,用于持久保留上次回发中的值的机制正在强制持久化一个不再存在的值。
It seems to me that the mechanism used to persist the values from the previous postback is forcefully persisting a value that no longer exists.
在我看来,用于持久保留上次回发中的值的机制正在强制持久化一个不再存在的值。
It is; 它是; you can turn EnableViewState property for control on or off.
您可以打开或关闭EnableViewState属性以进行控制。
I suppose you need to clear properties Text and/or SelectedValue of your Telerik.Web.UI.RadComboBox instance that persists outdated value. 我想您需要清除持久化过时值的Telerik.Web.UI.RadComboBox实例的属性Text和/或SelectedValue。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.