Won't Fix
Last Updated: 13 Nov 2024 16:45 by ADMIN
Jian
Created on: 14 Oct 2022 19:48
Category: ListView
Type: Feature Request
5
ListView: Default Group Settings - allow groups to be collapsed initially

Hi Team,

In the current RadListView implementation, the RadListView will start with all the groups expanded. The only way to have any form of preference is to programmatically interact with the Dataview after-the-fact https://docs.telerik.com/devtools/maui/controls/listview/grouping/expand-collapse 

This is problematic because I need to take a wild guess as to how long it takes for the data to load in the RadListView.Loaded event and then manually collapse them.

Even if I time this perfectly... this results in visual flash for the user because the ListView starts expanded and immediately collapses.

Requested Feature

A better approach that I am requesting a feature for is to have a property available for the RadListView that sets this value ahead of time.

For example, you could add it as a BindableProperty on the GroupDescriptorBase class. 

// THE OFFICIAL BASE CLASS
public abstract class GroupDescriptorBase : OrderedDescriptorBase, IKeyLookup
{
    public object GetKey(object item) => this.GetKeyCore(item);

    protected abstract object GetKeyCore(object item);

    protected virtual object GetDefaultKey(object item) => item;

    // SUGGESTED IMPROVEMENT
    public bool IsExpanded
    {
        get => (bool)GetValue(IsExpandedProperty);
        set => SetValue(IsExpandedProperty, value);
    }
    
    public static readonly BindableProperty IsExpandedProperty = BindableProperty.Create(
        nameof(IsExpanded), 
        typeof(bool), 
        typeof(GroupDescriptorBase), 
        true,  // the default right now is true... do not change that because no breaking changes
        propertyChanged: OnIsExpandedChanged);
    
    static void OnIsExpandedChanged(BindableObject bindable, object oldValue, object newValue)
    {
        if (bindable is GroupDescriptorBase self)
        {
            if (!(bool)newValue)
            {
                // PLEASE DO NOT START WITH GROUPS EXPANDED
            }
        }
    }
}

 

Or you could even put it a little lower, next to the BindableProperty SortOrder:

Thank you for your consideration,

Jian

 

on the GroupDefinition is to have a IsExap

3 comments
ADMIN
Didi
Posted on: 13 Nov 2024 16:45

Hi all,

The status of this item is set to Won't fix as the RadListView control is now obsolete and will be removed in the future. Use the RadCollectionView control instead. All votes are migrated to the newly created item for the RadCollectionView: CollectionView: Allow groups to be collapsed initially

The RadCollectionView is a complete, ground-up rewrite of the ListView. The RadCollectionView offers improved performance, enhanced features, and a modernized approach to managing lists of data. The RadCollectionView incorporates all of the ListView's key features. More about the differences between both components and how to migrate to the new RadCollectionView is available in the Migrating the Telerik .NET MAUI RadListView to RadCollectionView article.

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Joe
Posted on: 07 Nov 2024 20:09
This is absolutely necessary.  For large lists having expanded by default makes no sense.  I am needing to add an event to send from my ViewModel to the code behind of the view to collapse, and as mentioned it flashes.
ADMIN
Didi
Posted on: 17 Oct 2022 08:26

Hi Jian,

Thank you for the feature request. I have changed the status to Unplanned. It is a valid feature and we will track its demand. 

Regards,
Didi
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.