ListView: Provide the option to set custom empty template
An example with CollectionView:
<CollectionViewItemsSource="{Binding EmptyMonkeys}"EmptyView="No items to display" />
5 comments
ADMIN
Didi
Posted on:10 Sep 2024 07:48
Hi all,
We have resolved this behavior by implementing a new control, CollectionView, which is a complete rewrite of the ListView from the ground up. CollectionView offers improved performance, enhanced features, and a modernized approach to managing lists of data. The CollectionView incorporates all key features of the ListView.
As this new control supersedes the ListView, this feature request will be closed. We recommend transitioning to CollectionView to take full advantage of its capabilities. Visit the following article that explains how to migrate to the new RadCollectionView.
This is definitely an expected feature, I not sure why it takes over a year to have something like this implemented.
I have recently purchased the whole suite in good faith and would expect fundamental features to be in place and added quicker than this.
Jason
Posted on:17 Mar 2023 13:04
Thanks, Didi,
I understand that there are workarounds available. For that matter, I could build all the functionality of your ListView control myself if I wanted to. The point of my comment is that if I'm going to spend $1000 or more on a UI framework, I expect features, not workarounds. Microsoft's built-in CollectionView has the EmptyView option already. It can handle the empty-list state with as little as one line of XAML. I would expect a commercial control to have at least feature parity with what you can get for free. As it stands, your suggested workaround costs around 20 lines of C# plus the required XAML. I'm unimpressed. If I find similar holes in other controls, I won't be buying.
ADMIN
Didi
Posted on:17 Mar 2023 05:37
Hi Jason,
The ListView does not have an empty template, this is why we have this feature request logged.
However there is an easy way to achieve an empty template:
- When your items source is empty, show the label. - When the collection is not empty, hide the label.