1 Answer, 1 is accepted
Hello Le,
The AutoComplete control uses the RadTextInput control inside its template, not RadEntry. To style the TextInput, use the TextInputStyle property. To style the clear button you can use the ClearButtonStyle property. More details for styling can be found here: https://docs.telerik.com/devtools/maui/controls/autocomplete/styling
If you want to fully customize the AutoComplete control template, in order to get the template, add the Telerik Theming to the project build and inside the TelerikTheming/Styles/Platform/AutoComplete.xaml file and review all resources for the control.
This is the option I can suggest.
Regards,
Didi
Progress Telerik
Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.
Dear Didi,
I need to customize Autocomplete control to add new button: "AddToBookmark" after the ClearButton; Can we do it by using Template? If can, please tell me the way..
Thanks Didi for your kindly support!
Le
Yes, you can use the template and customize the control, by adding/removing elements to/from it. I have shared a way how to get the template. I am pasting my reply here:
If you want to fully customize the AutoComplete control template, in order to get the template, add the Telerik Theming to the project build and inside the TelerikTheming/Styles/Platform/AutoComplete.xaml file and review all resources for the control.
So you can get the template from the theming folder and then further customize it. Where to add the UI element for bookmark inside the control template of the AutoComplete is up to you, it is based on your scenario.
Here is the control template:
<ControlTemplate x:Key="RadAutoComplete_ControlTemplate">
<telerikMauiControls:RadWrapLayout x:Name="PART_WrapLayout"
BackgroundColor="Transparent"
StretchLastChild="True"
AutomationId="RadAutoCompleteViewWrapLayout">
<telerikMauiControls:RadDockLayout x:Name="PART_DockLayout">
<telerikMauiControls:RadTemplatedButton x:Name="PART_ClearButton"
IsEnabled="{TemplateBinding IsEnabled}"
Command="{TemplateBinding ClearTextCommand}"
Style="{TemplateBinding ActualClearButtonStyle}"
telerikMauiControls:RadDockLayout.Dock="Right"
AutomationId="RadAutoCompleteClearButton" />
<telerikMauiControls:RadTextInput x:Name="PART_Input"
Style="{TemplateBinding ActualTextInputStyle}"
IsEnabled="{TemplateBinding IsEnabled}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontAttributes="{TemplateBinding FontAttributes}"
Text="{TemplateBinding Text, Mode=TwoWay}"
TextColor="{TemplateBinding TextColor}"
PlaceholderColor="{TemplateBinding PlaceholderColor}"
Keyboard="{TemplateBinding Keyboard}"
AutomationId="RadAutoCompleteTextInput" />
</telerikMauiControls:RadDockLayout>
</telerikMauiControls:RadWrapLayout>
</ControlTemplate>
Hope this will be of help.