New to Telerik UI for .NET MAUI? Start a free 30-day trial

.NET MAUI Entry ToolbarItem

Add input fields to the Toolbar by using the EntryToolbarItem.

The available configuration property is:

  • Text(string)—Defines the text (target type Label) in the toolbar item. You can display an image next to the text.

Events

The Entry Toolbar item emits the following events:

  • TextChanged—Raised when the EntryToolbarItem.Text property has changed.
  • EntryCompleted—Raised when the user finalizes the text in the Microsoft.Maui.Controls.Entry control by pressing the Return key.

Styling

You can style the EntryToolbarItem by using the following property:

  • Style—The target type of the property is the EntryToolbarItemView control.

In addition to the Style property that is specific to the Telerik EntryToolbarItem, you can also use the EntryStyle property (target type RadEntry) and use all properties that are available for customizing and styling the RadEntry control. Some of these properties are:

  • TextColor(Microsoft.Maui.Graphics.Color)—Specifies the color of the text in the toolbar item.
  • Placeholder(string)—Specifies the text that is displayed when the control is empty.
  • PlaceholderColor(Microsoft.Maui.Graphics.Color)—Specifies the color of the text that is displayed when the control is empty.
  • FontFamily(string)—Specifies the font family of the text to display in the toolbar item.
  • FontAutoScalingEnabled(bool)—Determines whether the font of the entry scales automatically according to the operating system settings. Default value is true.
  • FontSize(double)—Specifies the font size of the text to display in the toolbar item.
  • FontAttributes(enum of type Microsoft.Maui.Controls.FontAttributes)—Defines the font attributes of the text to display in the toolbar item. Default value is None.
  • HorizontalTextAlignment(enum of type Microsoft.Maui.TextAlignment)—Defines the horizontal alignment of the text to display in the toolbar item. The default value is Start.
  • VerticalTextAlignment(enum of type Microsoft.Maui.TextAlignment)—Defines the vertical alignment of the text to display in the toolbar item. Default value is Center.
  • HorizontalOptions(enum of type Microsoft.Maui.Controls.LayoutOptions)—Specifies the horizontal alignment options of the content displayed in the toolbar item.
  • VerticalOptions(enum of type Microsoft.Maui.Controls.LayoutOptions)—Specifies the vertical alignment options of the content displayed in the toolbar item.

The following example demonstrates how to style the EntryToolbarItem.

1. Apply the style in the resources:

<Style TargetType="telerik:RadEntry" x:Key="entryStyle">
    <Setter Property="Placeholder" Value="EntryToolbar"/>
</Style>

2. Add the EntryToolbarItem definition:

 <telerik:EntryToolbarItem EntryStyle="{StaticResource entryStyle}"/>

See Also

In this article