Completed
Last Updated: 08 Mar 2018 09:15 by ADMIN
ADMIN
Dinko | Tech Support Engineer
Created on: 30 Oct 2017 12:11
Category: WatermarkTextBox
Type: Bug Report
0
WatermarkTextBox: Setting SelectionOnFocus property does not work
When setting this property to CaretToEnd, a possible workaround which can be used is to subscribe to the GotFocus event of the control. In the event handler you can set the SelectionStart property to the length of the text using a Dispatcher.BeginInvoke() method.  

private void RadWatermarkTextBox_GotFocus(object sender, RoutedEventArgs e)
{
	var watermarkTextBox = sender as RadWatermarkTextBox;
	if(watermarkTextBox!= null)
	{	
		Dispatcher.BeginInvoke((Action)(() =>
		{
			watermarkTextBox.SelectionStart = watermarkTextBox.Text.Length;
		}));
	}
}
1 comment
ADMIN
Yoan
Posted on: 08 Mar 2018 09:15
The fix is available in the R1 2018 Release.