This is a migrated thread and some comments may be shown as answers.

[Grouping] Blank item for an empty group

1 Answer 103 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Vardan
Top achievements
Rank 1
Vardan asked on 21 Jan 2021, 11:37 AM

HI folks.

 

I am using the rad list view with grouping in my application. There are some cases when the list has empty groups (That's ok because according to the application's logic I can move items between groups). The problem is that the empty group it's not actually "Empty". It has a blank item which is not desirable behavior for me. I have a list view "item tapped" event which navigates the user to the details screen and when I tap on the empty group's item the application throws an exception because the list item is blank. I have attached a sample app according to this example  and GIF files showing the issue.

 

1 Answer, 1 is accepted

Sort by
0
Didi
Telerik team
answered on 25 Jan 2021, 09:04 AM

Hello Vardan,

Thank you for the provided information. 

I have used the project you have attached here: https://feedback.telerik.com/xamarin/1503290-radlistview-grouping-blank-item-for-an-empty-group 

Let me explain in detail: 

The behavior you are observing with the empty item is expected. When there is an item the listview will display it, no matter whether there is text inside it/ null or empty string:

Example:

 new City {Name = null, Country = "Empty Item", Description = null},

This is a valid item and listview will visualize it. The same behavior is represented in the Xamarin.Forms CollectionView. 

It is not an issue, this is how the RadListView handles the item. 

About the exception, I could not reproduce it with the project attached in the bug report item. 

I have noticed that you have added inside the ItemTapped event null check. Yes, you can use this approach and navigate to another page when the Name of the item is not null. 

I hope the provided information was helpful.

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

Tags
ListView
Asked by
Vardan
Top achievements
Rank 1
Answers by
Didi
Telerik team
Share this question
or