This is a migrated thread and some comments may be shown as answers.

Pickers in a ListView firing ItemTemplateSelector

2 Answers 73 Views
ListView
This is a migrated thread and some comments may be shown as answers.
IanV
Top achievements
Rank 1
Veteran
IanV asked on 17 Jun 2019, 09:57 PM

We are using the RadListView and have added a Picker ontrol.

When the user selects an item in the Picker, the RadListView's ItemTemplateSelector fires and reloads the cell, loosing the values.

How can we stop the ItemTemplateSelector from firing when a picker is selected?

 

<dataControls:RadListView
x:Name="list"
IsVisible="{Binding IsLoading, Converter={StaticResource NegateBooleanConverter}}"
ItemsSource="{Binding Items}"
BackgroundColor="White"
IsPullToRefreshActive="{Binding IsBusy}"
IsPullToRefreshEnabled="True"
                SelectionMode="None">
 
<dataControls:RadListView.ItemTemplateSelector>

2 Answers, 1 is accepted

Sort by
0
IanV
Top achievements
Rank 1
Veteran
answered on 17 Jun 2019, 10:10 PM

To reproduce this, add this demo Picker to a RadListView which uses an Item selector. When you choose a monkey, the Selector re-fires clearing the selection

 

<Picker x:Name="picker"Title="Select a monkey"TitleColor="Red"><Picker.ItemsSource><x:Array Type="{x:Type x:String}"><x:String>Baboon</x:String><x:String>Capuchin Monkey</x:String><x:String>Blue Monkey</x:String><x:String>Squirrel Monkey</x:String><x:String>Golden Lion Tamarin</x:String><x:String>Howler Monkey</x:String><x:String>Japanese Macaque</x:String></x:Array></Picker.ItemsSource></Picker>

0
Lance | Manager Technical Support
Telerik team
answered on 18 Jun 2019, 05:35 PM
Hello Ian,

Thank you for the details, I built a test with that Picker implemented in a DataTemplate used by the TemplateSelector.

However, I was not able to replicate what you've reported on any of the platforms (Android, iOS or UWP). Please try the attached project and see this on your end. Disregard the project name's relevance, you'll find the RadListView and related classes on MainPage and MainPage.xaml.cs.

Note that the project uses Telerik UI for Xamarin 2019.2.603 and Xf 3.6 (the latest supported options).


Further Investigation

In general, if a TemplateSelector is being invoked, then there was usually a property changed event, trigger or other update mechanism in play. If you could update my demo so that it replicates the issue and send it back to me, I can forward it to the development team for further investigation.

Since you cannot open a support ticket to attach a ZIP file, you can instead host it on DropBox/OneDrive/etc and send me a download link instead.


Relevancy Note:

Before updating the demo, please try your implementation with a normal Xamarin.Forms ListView to eliminate if the problem is a Xamarin.Forms-specific issue or a Telerik RadListview-specific issue.

Regards,
Lance | Technical Support Engineer, Principal
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
ListView
Asked by
IanV
Top achievements
Rank 1
Veteran
Answers by
IanV
Top achievements
Rank 1
Veteran
Lance | Manager Technical Support
Telerik team
Share this question
or