New to Telerik UI for .NET MAUI? Start a free 30-day trial
Limiting Characters in Entry and ComboBox Controls in UI for .NET MAUI
Updated on Dec 16, 2025
Environment
| Version | Product | Author |
|---|---|---|
| 12.0.0 | Telerik UI for .NET MAUI Entry | Dobrinka Yordanova |
| 12.0.0 | Telerik UI for .NET MAUI ComboBox | Dobrinka Yordanova |
Description
I want to restrict the number of characters typed in an Entry or ComboBox control in UI for .NET MAUI applications.
This knowledge base article also answers the following questions:
- How to set a maximum character limit in Telerik MAUI Entry?
- How to access ComboBox's input and set character restrictions?
- How can I handle text changes in ComboBox or Entry?
Solution for MAUI Entry
The Telerik MAUI Entry control provides a MaxLength property to define the maximum number of characters allowed. It also supports a TextChanged event to track text changes.
xml
<telerik:RadEntry MaxLength="10" TextChanged="OnTextChanged" />
Solution for MAUI ComboBox
The ComboBox uses the RadTextInput control for text input when in editable mode. You can access RadTextInput through the Loaded event of RadComboBox and set the MaxLength property.
xml
<VerticalStackLayout>
<telerik:RadComboBox ItemsSource="{Binding Locations}"
DisplayMemberPath="City"
IsEditable="True"
x:Name="combo"
Loaded="RadComboBox_Loaded" />
</VerticalStackLayout>
In the code-behind, access RadTextInput and define the character limit:
csharp
private void RadComboBox_Loaded(object sender, EventArgs e)
{
var textInput = ChildOfType<RadTextInput>(this.combo);
textInput.MaxLength = 4;
textInput.TextChanged += TextInput_TextChanged;
}
private void TextInput_TextChanged(object? sender, TextChangedEventArgs e)
{
// Handle text changes if needed.
}
internal static T ChildOfType<T>(View visualElement) where T : View
{
if (visualElement == null)
{
return null;
}
foreach (var item in VisualTreeElementExtensions.GetVisualTreeDescendants(visualElement))
{
if (item is T targetElement)
{
return targetElement;
}
}
return null;
}