1. Bind the CheckedItems collection of the TreeView to the CollectionView ItemsSource.
2. there aren't any items in the TreeView initially. Add items to it
3. Start checking the checkboxes
4. The items are added to the CollectionView, still they are not visible in the control.
Having a RadExpander inside the ItemTemplate breaks the Drag and Drop gesture of the RadCollectionView.
When Using MAUI CollectionView and RadExpander in the template, drag and drop works.
The content inside the swipe template is missing when using MAUI 9.0.40 and Telerik MAUI 10.0.0
Workaround:
Use MAUI 9.0.30 and Telerik MAUI 10.0.0
The ItemsSource of the views is populated in the ViewModel of the page. This is done in a command that is triggered by the NavigatedTo event of the page, which is forwarded via EventToCommandBehavior from the Maui Toolkit.
When using the RadCollectionView the loaded items are no longer displayed.
When the ObservableCollection of the items is completely reconstructed and reassigned the display works.
See simple example baaaaif/CollectionViewFilterIssue (MainPage.xaml.cs) to reproduce, click hide and show
When items are filtered through a FilterDescriptor they are hidden - correct
Trying to show the previously hidden items they don't appear again as expected - bug
I've used a BooleanFilterDescriptor and a DelegateFilterDescriptor, both don't work.
Stops me from using the RadCollectionView control
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.
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.