Customize radEntry of AutoComplete

1 Answer 9 Views
AutoComplete
Le
Top achievements
Rank 1
Iron
Le asked on 29 May 2025, 08:21 PM

Dear Telerik,

Can we customize radEntry of AutoComplete - like: add new button after Clear button?

 

1 Answer, 1 is accepted

Sort by
1
Didi
Telerik team
answered on 30 May 2025, 06:13 AM

Hello Le,

The AutoComplete control uses the RadTextInput control inside its template, not RadEntry. To style the TextInput, use the TextInputStyle propertyTo 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.

    Le
    Top achievements
    Rank 1
    Iron
    commented on 30 May 2025, 09:16 AM

    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

     

    Didi
    Telerik team
    commented on 30 May 2025, 09:58 AM | edited

    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. 

     

    Le
    Top achievements
    Rank 1
    Iron
    commented on 30 May 2025, 10:30 AM

    Thanks Didi!
    Tags
    AutoComplete
    Asked by
    Le
    Top achievements
    Rank 1
    Iron
    Answers by
    Didi
    Telerik team
    Share this question
    or