RadListPicker Templates

1 Answer 22 Views
ListPicker
Anthony
Top achievements
Rank 1
Iron
Veteran
Anthony asked on 27 Nov 2024, 11:29 PM

Hi,

Are you able to provide the default control templates for the RadListPicker so that I can tweak them?

On Android the underline border is too far below the text and does not give a consistent look and feel compared to native controls.

Regards

Anthony

Didi
Telerik team
commented on 28 Nov 2024, 08:47 AM

Hi Anthony,

The available templates are described here: https://docs.telerik.com/devtools/maui/controls/listpicker/templates Let me know which template you want to modify and I will send the code.

Anthony
Top achievements
Rank 1
Iron
Veteran
commented on 01 Dec 2024, 09:24 PM

Hi Didi,

The PlaceholderTemplate and the DisplayTemplate please.

Regards

Anthony

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 02 Dec 2024, 01:11 PM

Hello Anthony,

I've attached a simple app with the requested default PlaceholderTemplate and DisplayTemplate.

Still, I'd like to mention, in case you'd need to modify only the underline border distance, this can be achieved only with modifying the PlaceholderLabelStyle and DisplayLabelStyle properties of the ListPicker:

 

<Style TargetType="Label" x:Key="MyDisplayLabelStyle">
    <Setter Property="Margin" Value="{OnPlatform Android='0, 0, 0, 0', iOS='8, 9', MacCatalyst='6, 8, 6, 7', WinUI='10, 5, 10, 6'}" />
</Style>

<Style TargetType="Label" x:Key="MyPlaceholderLabelStyle">
    <Setter Property="Margin" Value="{OnPlatform Android='0, 0, 0, 0', iOS='8, 9', MacCatalyst='6, 8, 6, 7', WinUI='10, 5, 10, 6'}" />
</Style>

And set these Styles to the ListPicker:

<telerik:RadListPicker x:Name="listPicker1" 
                    Placeholder="Pick a name!" 
                    DisplayMemberPath="Name"
                    PlaceholderLabelStyle="{StaticResource MyPlaceholderLabelStyle}"
                    DisplayLabelStyle="{StaticResource MyPlaceholderLabelStyle}"/>

You can take a look at the ListPicker Styling topic for more details on the provided style properties.

I hope I was of help.

Regards,
Yana
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.

Anthony
Top achievements
Rank 1
Iron
Veteran
commented on 02 Dec 2024, 09:49 PM

Thanks

Tags
ListPicker
Asked by
Anthony
Top achievements
Rank 1
Iron
Veteran
Answers by
Yana
Telerik team
Share this question
or