is opened, it gets the focus of the application. So RadWatermarkTextBox
goes to Unfocused state, which causes the loosing of the selection (only visual, if you check SelectedText property, you'll notice the selection is not lost at all). WPF's ContextMenu for TextBox is a special one, that doesn't get the focus. It uses some internal framework constructions in order to allow both selection in TextBox and ContextMenu to be focused. Our RadContextMenu
is designed to support multiple scenarios, including Keyboard Navigation, placing it inside RadDropDownButton, etc. If we do not focus RadContextMenu
when it is opened, you'll lose Keyboard Navigation and pressing any of the keyboard keys will close the menu.
In order to achieve this case you can inherit RadContextMenu
and override OnOpened
method. In its body you shouldn't call base.OnOpened() and this way you'll have the menu opened and the selection in the watermark will be visible. Please note that using any of the keyboard keys will close the menu. You can handle KeyDown event of RadWatermarkTextBox
and try to implement your own logic what should happen in situation where RadContextMenu is opened and the user had pressed one of the keyboard keys.
Hope this helps.
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos
and start improving your app based on facts, not hunches.