Unplanned
Last Updated: 16 Apr 2019 12:42 by ADMIN
Safan
Created on: 15 Apr 2019 08:13
Category: DataGrid
Type: Bug Report
10
Cannot ungroup column with "DelegateGroupDescriptor"

I have an custom column extending "DataGridTextColumn". This column overrides "CreateGroupDescriptor" methods and returns an instance of "DelegateGroupDescriptor". Once we group items in this column it can never be cleared/un-grouped.

 

Any help would be heighly appreciated. Thanks in advance.

1 comment
ADMIN
Lance | Senior Manager Technical Support
Posted on: 15 Apr 2019 13:57
Hi Mohamed,

Thank you for reporting this, I reproduced the issue and observed that the column menu's Group button doesn't change to Ungroup after a custom column's GroupDescriptor is added via the overridden CreateGroupDescriptor method (see my the Reproducible and Workaround sections below).

I've converted this thread to a Bug Report in the Telerik UI for Xamarin Feedback Portal. The development team will review the report and update the status of this item.


Reproducible

public class MyTextColumn : DataGridTextColumn
{
    protected override GroupDescriptorBase CreateGroupDescriptor()
    {
        return new DelegateGroupDescriptor{ KeyLookup = new LastLetterIKeyLookup() };
    }
}
 
public class LastLetterIKeyLookup : Telerik.XamarinForms.Common.Data.IKeyLookup
{
    public object GetKey(object item)
    {
        if (item is Data data)
        {
            return data.Country.LastOrDefault();
        }
 
        return "Unknown";
    }
}

Steps to Reproduce:

1. Open the custom column's menu and group it
2. Open the custom column's menu and observe that the Group button is still on "Group" instead of "Ungroup"

You are unable to ungroup the column via the default grouping UI.


Workaround

In order to workaround this, you'll need to programmatically clear the groups. I have attached a demo so that you can observe this at runtime. For your convenience, here's the method used to clear group descriptors.

private void ClearGroupsButton_OnClicked(object sender, EventArgs e)
{
    DataGrid.GroupDescriptors.Clear();
}


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
Attached Files: