When updating to Telerik MAUI 8.0.0 and building the app on Android 5.1 the controls that use RadTextInput internally crash
Controls like, DataGrid, RadEntry, ComboBox, AutoComplete, Numeric, Masked
UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.NoSuchMethodError: no non-static method "Landroidx/appcompat/widget/AppCompatEditText;.getTextCursorDrawable()Landroid/graphics/drawable/Drawable;"
[MonoDroid] at Java.Interop.JniEnvironment.InstanceMethods.GetMethodID(JniObjectReference type, String name, String signature)
[MonoDroid] at Java.Interop.JniType.GetInstanceMethod(String name, String signature)
[MonoDroid] at Java.Interop.JniPeerMembers.JniInstanceMethods.GetMethodInfo(String method, String signature)
[MonoDroid] at Java.Interop.JniPeerMembers.JniInstanceMethods.GetMethodInfo(String encodedMember)
[MonoDroid] at Java.Interop.JniPeerMembers.JniInstanceMethods.InvokeVirtualObjectMethod(String encodedMember, IJavaPeerable self, JniArgumentValue* parameters)
[MonoDroid] at Android.Widget.TextView.get_TextCursorDrawable()
[MonoDroid] at Telerik.Maui.Handlers.RadTextInputHandler.MapCustomCursorColor(RadTextInputHandler handler, IRadTextInput virtualElement)
[MonoDroid] at Microsoft.Maui.PropertyMapper`2.<>c__DisplayClass5_0[[Telerik.Maui.IRadTextInput, Telerik.Maui.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=5803cfa389c90ce7],[Telerik.Maui.Handlers.RadTextInputHandler, Telerik.Maui.Core, Version=8.0.0.0, Culture=neutral, PublicKeyToken=5803cfa389c90ce7]].<Add>b__0(IElementHandler h, IElement v)
[MonoDroid] at Microsoft.Maui.PropertyMapper.UpdatePropertyCore(String key, IElementHandler viewHandler, IElement virtualView)
[MonoDroid] at Microsoft.Maui.PropertyMapper.UpdateProperties(IElementHandler viewHandler, IElemen
.....
"System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Maui.Controls.Compatibility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'"
Occurs when creating a blank .net maui project using .net9 and adding Telerik MAUI NuGet Package latest version 8.0.0
Repro steps:
1. Create a new dotnet9 basic project in visual studio. 2. Launch it on windows. it runs. 3. Add the Telerik.UI.for.Maui.Trial package, version 8. (don't bother adding the UseTelerik line to MauiProgram.cs, it'll fail either way). 4. Clean and Rebuild the solution. 5. Debug the app on windows again. It fails on launch with a file not found error that seems to relate to: "Exception thrown: 'System.IO.FileNotFoundException' in Telerik.Maui.Controls.Compatibility.dll" System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Maui.Controls.Compatibility, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. The system cannot find the file specified.'
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.
In the current CollectionView implementation, the CollectionView will start with all the groups expanded. The only way to have any form of preference is to programmatically interact with the DataView after-the-fact https://docs.telerik.com/devtools/maui/controls/collectionview/grouping/expand-collapse
Requested Feature