Declined
Last Updated: 04 Feb 2016 11:45 by ADMIN
ADMIN
Telerik Admin
Created on: 15 May 2013 15:09
Category: WatermarkTextBox
Type: Bug Report
3
The KeyUp/KeyDown events sometimes are not triggered when using Keyboard.Modifiers.
The KeyUp/KeyDown events sometimes are not triggered when using Keyboard.Modifiers. The issue can be reproduces if the keyboard key combination is pressed quickly.

Useful case where using those modifiers is when the desired behavior is to restrict the Ctrl+Z (undo command) in the RadWatermarkTextBox control.
1 comment
ADMIN
Polya
Posted on: 04 Feb 2016 11:45
This is a framework issue in Silverlight. The same problem occurs with a normal TextBox and handler to its KeyDown event. The framework doesn't send correct e.Key in the arguments when ctrl+z is pressed. It sends "Control" as key instead of "Z".
The workaround is to create a custom RadWatermarkTextBox:
public class CustomWatermark : RadWatermarkTextBox
{
	protected override void OnKeyDown(KeyEventArgs e)
	{
		if ((ModifierKeys.Control == Keyboard.Modifiers) && e.Key == Key.Z)
		{
			e.Handled = true;

			return;
		}	

		base.OnKeyDown(e);
	}
}