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:
<ContentPagexmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"...><ContentPage.Resources><DataTemplatex:Key="MyItemTemplate"><LabelText="{Binding }" /></DataTemplate><local:MyTemplateSelectorx:Key="MyItemTemplateSelector"... /><ContentPage.Resources><!-- Both of these will work --><telerik:RadComboBoxItemTemplate="{StaticResource MyItemTemplate}" /><telerik:RadComboBoxItemTemplate="{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