Exception occurs when there are no items in the collection and load on demand mode is automatic:
public ViewModel()
{
this.Source = new ObservableCollection<string>();
//for (int i = 0; i < 14; i++)
//{
// this.Source.Add(string.Format("Item {0}", i));
//}
this.LoadItemsCommand = new Command(this.LoadItemsCommandExecute);
}
When Group Header template is used and the visibility of an element in the template is changed, the template does not recreate as expected.
For example add entry /editor in the template and change its visibility
On iOS the editor/entry overlaps the group header and cannot type in it.
On UWP : The editor is visualized as expected but then we change its visibility to false, the space for the editor is still visible. The group header does not layout as expected.
Solution:
You have to collapse/expand the group header so the template in the group header to layout as expected
With iOS 16 some changes are introduced to the UICollectionView. This breaks the layout of the ListView with dynamically sized items.
when we try to add a dynamic AutomationId in each item of the list (something like AutomationId="{Binding Id}"), the AutomationId is not provided to the elements we see in the appium inspector.
Works with fixed values
When adding swipe content, it block the button to be clicked when the items in the cell matches the swipe offset value,
a. reduce the swipe offset.
b. place the minus button further to the left, so the button width to match the ListView swipe offset
Sample setup:
<telerikDataControls:RadListView x:Name="listView"
IsItemSwipeEnabled="True"
SwipeOffset="90, 0, 0, 0"
SwipeThreshold="20"
ItemsSource="{Binding Source}"
SelectionMode="None">
<telerikDataControls:RadListView.ItemTemplate>
<DataTemplate>
<listView:ListViewTemplateCell>
<listView:ListViewTemplateCell.View>
<Grid ColumnDefinitions="*,90">
<!-- >> changed second row to 90 pixels, which is swipe offset -->
<Label
FontAttributes="Bold"
FontSize="16"
Text="{Binding Sender}"
TextColor="Black" />
<StackLayout Grid.Column="1"
Orientation="Horizontal">
<Button
Clicked="Button_Clicked_1"
Text="+++"
TextColor="Gray" />
<Button
Clicked="Button_Clicked"
Text="---" />
</StackLayout>
</Grid>
</listView:ListViewTemplateCell.View>
</listView:ListViewTemplateCell>
</DataTemplate>
</telerikDataControls:RadListView.ItemTemplate>
<telerikDataControls:RadListView.ItemSwipeContentTemplate>
<DataTemplate>
<Grid
Margin="0"
Padding="0"
ColumnSpacing="0"
RowSpacing="0">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="90" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<telerikInput:RadButton
Grid.Column="0"
Margin="0"
BackgroundColor="Red"
Clicked="RadButton_Clicked"
FontFamily="FontAwesomeSolid"
FontSize="Medium"
Text=""
WidthRequest="90" />
</Grid>
</DataTemplate>
</telerikDataControls:RadListView.ItemSwipeContentTemplate>
</telerikDataControls:RadListView>
is thrown when navigating to another view using ListView SelectedItem and removing the view where the ListView is placed.
Workaround:
Instead of removing the view, change the view visibility.
On Android when adding new item to the ListView which is RadExpander with RadListView inside it, and when removing and adding item with different length the cell is not measured correctly.
On iOS the ListView cell are not automatically sized. one height for cell is used
On UWP when adding the second item the app crashes with "System.ArgumentException: An item with the same key has already been added. Key: SDKBrowser.Examples.ListViewControl.GettingStartedCategory.GettingStartedExample.Product\r\n at System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object key)\r\n at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)\r\n at Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayoutStrategy.RecycleLocally()\r\n at Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayout"
When applying multi-level grouping, then change the items group keys, the new groups are added but the old ones are still visible in the list view, and from child group they become parent group.
Workaround:
clear the group descriptors before changing the items and then re-add the group descriptors again
This is from our production app. Cannot reproduce it, don't know exactly when or why it happens; we just have crashes logged to have happened to 9 users in the past year with a total of 30 occurences.
These are unhandled UWP exceptions, which mean that our app goes poof :)
System.ArgumentException: Value does not fall within the expected range at
System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object) + 0xf at
Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayoutStrategy.RecycleLocally() + 0x320 at Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayoutStrategy.MeasureContent(RadSize, Double, Double) + 0xd at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.MeasureVertical(RadSize) + 0x1b9 at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.MeasureContent(RadSize) + 0x42 at Telerik.UI.Xaml.Controls.Data.ListViewModel.MeasureContent(RadSize) + 0x2e at Telerik.UI.Xaml.Controls.Data.RadListView.OnContentPanelMeasure(RadSize) + 0x17f at Telerik.UI.Xaml.Controls.Data.ListView.ListViewPanel.MeasureOverride(Size) + 0x60 at Windows.UI.Xaml.FrameworkElement.global::Windows.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size) + 0x26
System.ArgumentException: An item with the same key has already been added at
System.ThrowHelper.ThrowAddingDuplicateWithKeyArgumentException(Object) + 0xf at Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayoutStrategy.RecycleLocally() + 0x320 at Telerik.UI.Xaml.Controls.Data.ListView.Model.BaseLayoutStrategy.MeasureContent(RadSize, Double, Double) + 0xd at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.MeasureVertical(RadSize) + 0x1b9 at Telerik.UI.Xaml.Controls.Data.ListView.Model.LayoutController.MeasureContent(RadSize) + 0x42 at Telerik.UI.Xaml.Controls.Data.ListViewModel.MeasureContent(RadSize) + 0x2e at Telerik.UI.Xaml.Controls.Data.RadListView.OnContentPanelMeasure(RadSize) + 0x17f at Telerik.UI.Xaml.Controls.Data.ListView.ListViewPanel.MeasureOverride(Size) + 0x60 at Windows.UI.Xaml.FrameworkElement.global::Windows.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size) + 0x26