Custom view not working in release mode on Android
Hi,
In my main project, I am using an SfPicker with a custom view via the ItemTemplate parameter, and I am encountering the following issue on Android:
- In debug mode: everything works fine.
- In release mode: the picker does not display anything.
I created a small project (attached) to test this, and I am experiencing the same issue:
Debug :
Release :
Thanks for your assistance.
Attachment: PickerTemplate_16a24c4c.zip
Hi Omar,
In SfPicker, the binding context for the ItemTemplate is the `PickerItemDetails` class. Therefore, we recommend specifying the data type for the DataTemplate using x:DataType to ensure the bindings are resolved correctly.
Example:
|
<Grid>
<Grid.Resources> <local:DataTModelConverter x:Key="converter" />
<DataTemplate x:Key="customView" x:DataType="picker:PickerItemDetails"> <StackLayout BackgroundColor="Yellow"> <Label HorizontalTextAlignment="Center" VerticalTextAlignment="Center" TextColor="Red" Text="{Binding Data,Converter={StaticResource converter} }" /> </StackLayout> </DataTemplate> </Grid.Resources>
<picker:SfPicker x:Name="Picker" ItemTemplate="{StaticResource customView}"> </picker:SfPicker>
</Grid>
|
We have updated your sample by adding x:DataType and attached the modified version for your review. Kindly check the attached sample and let us know if the issue persists or if you need any further clarification.
Regards,
Vidyalakshmi M.
Attachment: PickerTemplate_dc77321e.zip
Hi Vidyalakshmi,
Thanks for your help, it's working now!
Maybe you should update the documentation with this point to help others :)
Here : https://help.syncfusion.com/maui-toolkit/picker/populating-items#adding-custom-view-to-items
Best regards,
Omar
Hi Omar,
Thank you for the update. We’re glad to hear that the issue has been resolved and everything is now working as expected. We’ll ensure the relevant documentation is updated to include this information.
If you have any further questions or need additional assistance, please feel free to reach out, we’re always happy to help.
Regards,
Vidyalakshmi M.
Hello Vidyalakshmi,
I notice that the documentation still hasn't been updated 😉
Please remember to do so, as it's incomplete as it stands.
Best regards,
Omar
Hi Omar,
We acknowledge that the documentation is not yet fully updated. Please be
assured that the update process is already underway, and the revised version
will be completed on or before mid-next week. We will validate and
update you with further details once completed. We sincerely appreciate your
patience and understanding as we finalize these changes.
Regards,
Hadaya Rahman M.
Hi Omar,
We’ve updated the documentation with the latest code changes. Please take a moment to review it using the link below.
Populating with .NET MAUI Picker Control
Thank you for your patience during this process.
If you need any further clarification or assistance, feel free to let us know, we’re always here to help.
Regards,
Vidyalakshmi M.
Hi Vidyalakshmi,
That's perfect, thank you!
Regards,
Omar
Hi Omar,
We’re glad to hear that the updated documentation meets your expectations. If you have any further questions or need additional assistance, please feel free to get in touch, we’ll be happy to help.
Regards,
Vidyalakshmi M.
- 8 Replies
- 3 Participants
-
OM Omar
- Jan 16, 2026 09:26 PM UTC
- Apr 13, 2026 11:40 AM UTC