Completed
Last Updated: 24 Feb 2021 13:06 by ADMIN
Release R1 2021 SP1
Aaron
Created on: 18 Dec 2019 22:02
Category: UI for Xamarin
Type: Bug Report
3
ListView: [iOS] ReorderItemStyle and PressedItemStyle are not applied to RadListView items when SelectionMode is None

When using the __ItemStyle properties of RadListView, they are not being applied if the SelectionMode is set to None. It makes sense that the PressedItemStyle and SelectedItemStyle properties are not used, since they are not applicable if nothing can be selected. However, the ReorderItemStyle in particular should still be used.

 

Example:

    public class ItemStyleNotAppliedExample : ContentPage
    {
        private readonly ListViewItemStyle WhiteBG = new ListViewItemStyle
        {
            BackgroundColor = Color.White
        };

        private readonly ListViewItemStyle YellowBG = new ListViewItemStyle
        {
            BackgroundColor = Color.Yellow
        };

        private readonly ListViewItemStyle RedBG = new ListViewItemStyle
        {
            BackgroundColor = Color.Red
        };

        private readonly ListViewItemStyle BlueBG = new ListViewItemStyle
        {
            BackgroundColor = Color.Blue
        };

        public ItemStyleNotAppliedExample()
        {
            BackgroundColor = Color.Gray;

            var items = new ObservableCollection<Item>
            {
                new Item("Item 1"),
                new Item("Item 2"),
                new Item("Item 3"),
                new Item("Item 4"),
                new Item("Item 5"),
            };

            Content = new RadListView
            {
                SelectionMode = SelectionMode.None,
                IsItemsReorderEnabled = true,
                ItemsSource = items,
                ItemTemplate = new DataTemplate(typeof(ItemView)),

                ItemStyle = WhiteBG,
                PressedItemStyle = YellowBG,
                SelectedItemStyle = RedBG,
                ReorderItemStyle = BlueBG,
            };
        }

        private class Item
        {
            public string Name { get; }

            public Item(string name)
            {
                Name = name;
            }
        }

        private class ItemView : ListViewTemplateCell
        {
            public ItemView()
            {
                var checkbox = new CheckBox
                {
                    VerticalOptions = LayoutOptions.Center
                };

                var label = new Label
                {
                    VerticalOptions = LayoutOptions.Center
                };

                label.SetBinding(Label.TextProperty, nameof(Item.Name));

                View = new StackLayout
                {
                    BackgroundColor = Color.Transparent,
                    Orientation = StackOrientation.Horizontal,
                    Children =
                    {
                        checkbox,
                        label
                    }
                };
            }
        }
    }

3 comments
ADMIN
Georgi
Posted on: 17 Feb 2021 09:00

Hi,

This item is available in latest internal build - LIB 2021.1.216 (16/2/2021)) and it will be also available in the next official release. You can find the LIB as a prerelease nuget or download the assemblies from your account.

Regards,
Georgi
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/.

ADMIN
Didi
Posted on: 08 Dec 2020 10:28

Hello,

The issue is valid also for the PressedItemStyle. When the selection mode is None, the PressedItemStyle is not applied. The Pressed and Reorder ItemStyles works on Android and UWP when SelectionMode is None. I have updated the bug report title based on these findings.

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/.

ADMIN
Yana
Posted on: 19 Dec 2019 13:22

Hello Aaron,

Thank you for providing the sample and reporting this issue.  Indeed, there is an issue related to these properties - ReorderItemStyle and PressedItemStyle are not applied on iOS ( although the selection is disabled, PressedItemStyle should be applied at the time the user taps/holds the item).

I have updated the status of the feedback item, as I confirm it is a valid bug report. For the moment, I cannot commit to a certain timeframe for providing a fix, please follow this item to get notified on any status changes.

I've also updated your points for your involvement on this.

Regards,
Yana
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