No way in Andoid to actually select a RadListPicker popup item.

1 Answer 90 Views
ListPicker
David
Top achievements
Rank 1
Iron
David asked on 06 Apr 2022, 01:40 PM

My mobile use of RadListPicker displays as a popup (expected -- that is the default). but I never see the buttons that should be at the end of the list, which itself can be fairly long. The documented Footer Template property appears to never have been implemented -- it is not in the metadata for RadListPicker, RadPickerBase, PickerContentView, RadContentView, etc.

I would like to use Telerik's Maui SDK Demo  project to see if a workaround exists, but it only builds for Windows. In Android I get the error:

"Error NETSDK1130 Microsoft.Graphics.Canvas.winmd cannot be referenced. Referencing a Windows Metadata component directly when targeting .NET 5 or higher is not supported. For more information, see https://aka.ms/netsdk1130"

As this does not happen in the Cryptocurrency sample (which does not use a ListPicker), I assume SDK has some Windows-specific code that needs replacement.

Even so, the real need is for a GestureRecognizer in the Spinner Control, which does not currently support them. Right now I can tap all I want on an item and the Selected Event never fires. That is understandable, in a way, as documentation says selection only occurs when user "confirms" his choice. Without either a GestureRecognizer or a footer, there is no current way to do that in popup.

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 11 Apr 2022, 05:30 AM

Hello David,

Let me get straight to the questions: 

1) ListPicker FooterTemplate. The FooterTemplate property is part of the PickerPopupSettings class. How to check the picker API. Hover the FooterTemplate with the mouse, then press F12, or hover the FooterTemplate, then right click on the mouse and select Go To Definitions from the menu. 



2) Regarding this issue: Error NETSDK1130 Microsoft.Graphics.Canvas.winmd cannot be referenced - I can't reproduce the error on my side. I successfully build and run the SDK MAUI app on Windows, Android, iOS, and macCatalyst. From the error message, it seems the package Microsoft.Graphics.Canvas cannot be referenced. Try clean, rebuild the solution, delete bin, obj folders, and restore NuGet packages. 

Here is the SDKMAUI app build for Windows and Android, and how the FooterTemplate looks:

3) GestureRecognizer for Spinner control. 

ListPicker populates its items using Spinner control. However you can add a TapGestureRecognizer to the element inside  the ItemTemplate: 

<DataTemplate x:Key="itemTemplate">
                <Label Text="{Binding Population}" 
                       BackgroundColor="LightYellow"
                       HorizontalTextAlignment="Center" 
                       VerticalTextAlignment="Center">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="TapGestureRecognizer_Tapped"/>
                    </Label.GestureRecognizers>
                </Label>
            </DataTemplate>
The label is inside the ListPicker ItemTemplate and the Tapped event is fired as expected. 

 

Could you please elaborate more on the scenario you want to achieve and how you use the GestureRecognizer and the FooterTemplate? If you can send the list picker definition that could be of help. 

Regards,
Didi
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

David
Top achievements
Rank 1
Iron
commented on 12 Apr 2022, 05:46 PM

Thank you for your pointers. I gave up on the RadListPicker control, finding the default MAUI Picker control did everything I needed. I still have your control commented out in those XAML areas and may someday see if I can get it to work as desired, but right now there is no need
Tags
ListPicker
Asked by
David
Top achievements
Rank 1
Iron
Answers by
Didi
Telerik team
Share this question
or