Unplanned
Last Updated: 13 Nov 2024 15:54 by Didi

Currently, the LoadOnDemandCollection accepts a callback of the following format in the constructor:

public LoadOnDemandCollection(Func<CancellationToken, IEnumerable> action)

It is a very common scenario to populate the items asynchronously. In its current form the collection would require blocking the current thread to populate the results:

ItemsSource = new LoadOnDemandCollection((cancelationToken) =>
{
    var result = new List<ItemsModel>();
    try
    {
        var items = dataService.GetItemsAsync().Result;

        // TODO: Handle the result.

        return result;
    }
    catch (Exception e)
    {
        // TODO: Handle the exception.
        return null;
    }
});

 

This is not desired, as using Task.Result blocks the current thread and is considered an anti-pattern, in general.

A better approach would be to add a second overload of the constructor, allowing asynchronous calls:

public LoadOnDemandCollection(Func<CancellationToken, Task<IEnumerable>> action)

This way we can use async and await in the callback instead:

ItemsSource = new LoadOnDemandCollection(async (cancelationToken) =>
{
    var result = new List<ItemsModel>();
    try
    {
        var items = await dataService.GetItemsAsync();

        // TODO: Handle the result.

        return result;
    }
    catch (Exception e)
    {
        // TODO: Handle the exception.
        return null;
    }
});

According to my tests, the first blocking approach is not a problem, as the LoadOnDemandCollection starts a thread internally. That behavior is not obvious however, and using Task.Result is somewhat counterintuitive, so the second approach is much better from the user's perspective.

Unplanned
Last Updated: 13 Nov 2024 15:52 by Didi

we have additional field in City class (CountryFlag as Image)

public class City
{
public string Name { get; set; }
public string Country { get; set; }
public Image CountryFlag { get; set; }
}

We want to display the image instead of the property we group by. Provide such option to define which proeprty to be displayed in the group header.

 

 

 

 

 

Unplanned
Last Updated: 13 Nov 2024 15:48 by Didi
Instead of reordering through the UI, expose an option to programmatically enter reordering.
Unplanned
Last Updated: 13 Nov 2024 15:47 by Didi
Created by: Didi
Comments: 0
Category: CollectionView
Type: Feature Request
4
Add events to handle when the CollectionView cells are unloaded/recycled and created.
Unplanned
Last Updated: 13 Nov 2024 15:45 by Didi
Created by: Didi
Comments: 0
Category: CollectionView
Type: Feature Request
6
Provide a way to set header and footer that are always visible in the CollectionView and are excluded from the scrolling.
Unplanned
Last Updated: 08 Nov 2024 14:53 by Marat
Currently, when the Move method of the ItemsSource collection is called for a certain item, the item position is immediately updated without animation.
Unplanned
Last Updated: 14 Oct 2024 18:57 by Alan

Currently the group descriptors provide a SortOrder property, so the groups are sorted alphabetically in descending or ascending order.  We would need to cover the following scenarios:

- allow certain groups to be ordered at the top, possibly by specifying an comparer or a separate group sort property.

- show the groups in order the corresponding items appear in the ItemsSource.

Unplanned
Last Updated: 18 Sep 2024 11:31 by Matthew
Created by: Matthew
Comments: 0
Category: CollectionView
Type: Feature Request
5

Add an option to scroll fast to elements inside the CollectionView, something like jump list approach.

This feature is available in the iOS UICollectionView https://developer.apple.com/documentation/uikit/uicollectionviewdatasource/2851455-indextitlesforcollectionview

It could be a great addition to the Telerik MAUI RadCollectionView features set.

 
Unplanned
Last Updated: 14 Aug 2024 08:18 by Steve
Created by: Steve
Comments: 0
Category: CollectionView
Type: Feature Request
3
We would like to give the user the ability to reorder the groups.
Declined
Last Updated: 14 Aug 2024 07:48 by ADMIN

As the Subject says - the CollectionView FooterTemplate Content IsVisible Property is ignored.
First i thought Binding update is not working, but it's not working at all, even if set "hard"

Take your Header & Footer CollectionView example and set IsVisible to false on the Grid

Completed
Last Updated: 07 Aug 2024 08:29 by ADMIN
Release 7.1.0 (2024 Q3)
Created by: Angus
Comments: 2
Category: CollectionView
Type: Feature Request
0
Provide an option to define header and footer templates
Completed
Last Updated: 07 Aug 2024 08:00 by ADMIN
Release 7.1.0 (2024 Q3)
I have a CollectionView that is populated when tapping on an item from another CollectionView. I am using the Add method to add the items to the CollectionView. But the items are duplicated (they are added two times).
1 2 3