Expose the Textbox's MaxLength property to limit text input on the RadAutoComplete SearchText Property
Posted on:08 Oct 2014 14:32
Thanks for your feedback.
Currently you can easily achieve the desired by hooking to the Loaded event handler of the control, get the TextBox there and set the desired MaxLength as shown below:
private void OnLoaded(object sender, RoutedEventArgs e)
var textBox = (sender as RadAutoCompleteBox).ChildrenOfType<TextBox>().FirstOrDefault();
if (textBox != null)
textBox.MaxLength = 4;
Posted on:24 Sep 2014 18:28
This control also does not expose the textbox.SelectionStart property.
When trying to work around the maxlength issue, it is not possible to reset the cursor position to the end of the input.
RadAutoCompleteBox box = sender as RadAutoCompleteBox;
box.SearchText = box.SearchText.Substring(0, Math.Min(box.SearchText.Length, 100));
//cursor is now positioned at the front of the input