ListView usage with Grouping options

1 Answer 45 Views
ListView
Zaynalobiddin
Top achievements
Rank 1
Zaynalobiddin asked on 03 Jan 2024, 06:27 PM

Hi Telerik Team,

May I kindly ask you if I could use ListView control in .NET MAUI with already grouped structure data type? I guess I could flatten my object source model, but I am interested if it is possible to use below model with ListView control and grouping options?

I have a ViewModel with a property type of ObservableCollection<T> MyProperty where T defined as:
public class T : List<T1>
{
public string Name {get;set;}
public string Area {get;set;}
}
and T1 as below:
public class T1
{
public string Id {get;set;}
public string ImgURL {get;set;}
//..some other properties
}

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 04 Jan 2024, 08:27 AM

Hello Zaynalobiddin,

I am afraid our .NET MAUI ListView works with flat data -  you just set its ItemsSource  (of type IEnumerable), to a list of items, grouping is implemented according to some logic related to the item properties ( you can use property group descriptor or a delegate group descriptor).

If you have to stay with the current structure, you can take a look at the TreeView control ( it works with hierarchical data, still, it misses other ListView features, such as filtering, header and footer templates, reorder, and other). The other option is the DataGrid control with its RowDetails.

Let me know if you have any additional questions on this.

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

Zaynalobiddin
Top achievements
Rank 1
commented on 04 Jan 2024, 01:47 PM

Hi Yana,

Thanks a lot for your brief and great explanation.

Thanks & Regards,

Zane

Tags
ListView
Asked by
Zaynalobiddin
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or