Declined
Last Updated: 05 May 2023 14:25 by ADMIN
Teddy
Created on: 04 May 2023 19:50
Category: ComboBox
Type: Feature Request
2
Add Support for DataTemplateSelector

Hi Team,

We have a need for being able to dynamically choose a template for the three available DataTemplate:

Thank you,

Teddy

1 comment
ADMIN
Lance | Senior Manager Technical Support
Posted on: 05 May 2023 14:25

Hello,

This has been marked as Declined because the feature already exists for the RadComboBox. To be specific, you can use a DataTemplate or a DataTemplateSelector for the item templates. For example:

<ContentPage xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui" ...>
    <ContentPage.Resources>
        <DataTemplate x:Key="MyItemTemplate">
            <Label Text="{Binding }" />
        </DataTemplate>
        
        <local:MyTemplateSelector x:Key="MyItemTemplateSelector" ... />
    <ContentPage.Resources>
    
    <!-- Both of these will work -->
    <telerik:RadComboBox ItemTemplate="{StaticResource MyItemTemplate}" />
    
    <telerik:RadComboBox ItemTemplate="{StaticResource MyItemTemplateSelector}" />
</ContentPage>

This is because of the nature of .NET MAUI's DataTemplateSelector uses a DataTemplate base class. As long as the UI component is checking to see if it's a selector and passes the correct args, it will work "out-of-the-box".

Regards,
Lance | Manager Technical Support
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.