开发者

Silverlight 4 toolkit AutoCompleteBox Text property not working

开发者 https://www.devze.com 2023-02-28 16:46 出处:网络
I capture the KeyUp event on an AutoComplete box from the Silverlight toolkit.If they press Escape I want to clear the value by calling autocompletebox.Text = string.Empty.This works most of the t开发

I capture the KeyUp event on an AutoComplete box from the Silverlight toolkit. If they press Escape I want to clear the value by calling autocompletebox.Text = string.Empty. This works most of the t开发者_JAVA百科ime, but whenever I set this when the whole field is selected it does not work. Is there another property that I should be setting instead of Text?


Try also assigning null to the SelectedItem property.

BTW Why are you using the toolkit, Silverlight 4 has an AutoCompleteBox, are you using SL3?


For anyone who may encounter this problem, it turns out that while you can set the Text property, the best approach is to set the SelectedItem property. I will submit this as a bug on Codeplex.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号