We have discovered an error when you implement IWindowCreator and create custom window and connect viewmodel via AddSingleton approach
This is the stack-trace:
at System.ThrowHelper.ThrowArgumentOutOfRange_IndexMustBeLessException() at System.Collections.Generic.List`1.get_Item(Int32 index) at Telerik.Maui.RadScreen.GetPixelScale(DipScaleType dipScaleType) at Telerik.Maui.Controls.RadScreenControls.GetPixelScale(VisualElement visualElement, DipScaleType dipScaleType) at Telerik.Maui.Controls.SkiaSharp.SkiaPainter.GetPixelScale() at Telerik.Maui.Controls.SkiaSharp.SkiaPainter..ctor(SkiaPainterCacheSettings cacheSettings) at Telerik.Maui.Controls.Compatibility.DataGrid.MasterArranger..ctor(RadDataGrid dataGrid, NonLayoutPanel root, SkLayoutSlotProvider skLayoutSlotProvider) at Telerik.Maui.Controls.Compatibility.DataGrid.RadDataGrid.InitArrangers() at Telerik.Maui.Controls.Compatibility.DataGrid.RadDataGrid.Telerik.Maui.Controls.Compatibility.DataGrid.IGridView.AttachColumn(DataGridColumn column) at Telerik.Maui.Controls.Compatibility.DataGrid.GridModel.AttachColumn(DataGridColumn column) at Telerik.Maui.Controls.Compatibility.DataGrid.DataGridColumnCollection.AttachColumn(DataGridColumn column) at Telerik.Maui.Controls.Compatibility.DataGrid.DataGridColumnCollection.InsertItem(Int32 index, DataGridColumn item) at System.RuntimeMethodHandle.InvokeMethod(Object target, Void** arguments, Signature sig, Boolean isConstructor) at System.Reflection.MethodBaseInvoker.InvokeDirectByRefWithFewArgs(Object obj, Span`1 copyOfArgs, BindingFlags invokeAttr)
When programatically trying to add an item to RadComboBox.SelectedItems (in multiple selection mode) similar to this answer, we get an ArgumentOutOfRangeException on iOS. It works fine on Android.
The stack trace is strange:
[0:] {"@t":"2023-11-15T20:53:41.1123080Z","@mt":"Unhandled Exception","@l":"Fatal","@x":"System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. (Parameter 'index')Error clang++ exited with code 1:
ld: in /Users/.../Library/Caches/Xamarin/mtbs/builds/SDKBrowserMaui/.../obj/x64/Debug/net7.0-ios/iossimulator-arm64/linker-cache/TelerikUI.a(TKChartAnnotation.o), building for iOS Simulator, but linking in object file built for iOS, file '/Users/.../Library/Caches/Xamarin/mtbs/builds/SDKBrowserMaui/.../obj/x64/Debug/net7.0-ios/iossimulator-arm64/linker-cache/TelerikUI.a'
clang: error: linker command failed with exit code 1 (use -v to see invocation) SDKBrowserMaui C:\Program Files\dotnet\packs\Microsoft.iOS.Sdk\16.4.7089\targets\Xamarin.Shared.Sdk.targets 1274
Steps to reproduce:
Run the SDKBrowser example from the Telerik UI for .NET MAUI 6.1.0 package following this instruction: https://www.telerik.com/blogs/running-ios-simulator-windows-net-maui
The paired Mac needs to have an Apple silicon (M1 or M2) chip.Using Telerik UI for .Net MAUI v1.0.1 with latest version MAUI 6.0.400 (Service Release 1) and Visual Studio 2022 17.3.0 Preview 2.0 generates an error,
Severity Code Description Project File Line Suppression State
Error PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry. MauiAppTest C:\Samples\MauiAppTest\MauiAppTest\WINAPPSDKGENERATEPROJECTPRIFILE 1
Hi team,
When deploying to certain platforms, under cetain circumstances, there is an exception that occurs in the DatePicker, TimePicker and a few other controls that rely on the same inner components. The stacktrace looks like it has to do with a default value for AppThemeBinding.
Thank you,
Nathan
I am using the SDKBrowser app to demonstrate the problem. This does not happen on the emulator but on my physical device (Samsung S22). I have created a video and attached it.
When I enter a value into the Numeric input and click on the "." button, the entry does create a "," sign. This is fine but the cursor jumps back in front of the comma. I have to physically move the cursor back and can only then continue entering the decimal values.
The second problem is, if I accidently click the "." a second time after entering the decimal values, the app crashes.
I suspected it could be the language settings on the device. I am from South Africa and change the language of the device from English (South Africa) to English (United States) and then it works as expected. Regardless of this, I would expect the control to work with any culture.
A number of RadDataGrid properties can be successfully set in App.xaml, but setting others causes the control to display nothing -- at least in Android.
While I have not tested all possible settings, these results were found experimentally:
Can be used: BackgroundColor, DataOperationIndicatorMode, GridLinesThickness, HorizontalOptions, LoadOnDemandMode, Margin, MinimumHeightRequest, SelectionMode, UserSortMode, VerticalOptions, and ViewportBufferHeight.
Cannot be used in App.Xaml style: AutoGenerateColumns, GridLinesColor, GridLinesVisibility, LoadOnDemandBufferItemsCount, RowHeight, and SelectionUnit.
Hi, I have created a page with a DataGrid on. I have set the datagrid as editable. When I run the app and double click on a cell the cell changes to an entry but the cell keeps on growing. It is also not very responsive then. Only when I tap somewhere else the cell changes back and it returns to its original size.
This only happens on Android.
Here is my XAML
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
x:Class="FertilizerFarm.View.LeafAnalysisEditPage"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:telerik="http://schemas.telerik.com/2022/xaml/maui"
xmlns:viewmodel="clr-namespace:FertilizerFarm.ViewModel"
x:DataType="viewmodel:LeafAnalysisEditViewModel"
xmlns:custom_components="clr-namespace:FertilizerFarm.View.Components"
Title="Leaf Analysis Detail">
<ContentPage.ToolbarItems>
<ToolbarItem Text="Save"
IconImageSource="save_icon.png"
Command="{Binding EditCommand}"
Order="Primary"
Priority="0" />
</ContentPage.ToolbarItems>
<StackLayout>
<VerticalStackLayout>
<Label Text="Land" Margin="10,12,10,0" FontSize="10" FontAttributes="Bold" TextColor="{StaticResource Primary}"></Label>
<telerik:RadComboBox IsClearButtonVisible="False"
ItemsSource="{Binding LandList}"
DisplayMemberPath="LandNumber"
Margin="10,0,10,2"
SearchTextPath="LandNumber"
SelectedItem="{Binding SelectedLand, Mode=TwoWay}"
SelectionMode="Single"
IsEditable="True"/>
<telerik:RadDataGrid x:Name="dataGrid" UserEditMode="Cell" ItemsSource="{Binding LeafAnalysis.Detail}" AutoGenerateColumns="False" UserFilterMode="Disabled">
<telerik:RadDataGrid.Columns>
<telerik:DataGridTextColumn PropertyName="Chemical" CanUserEdit="False"
HeaderText="Chemical">
<telerik:DataGridTextColumn.CellContentStyle>
<telerik:DataGridTextCellStyle TextColor="Green"
FontSize="15"
SelectedTextColor="Orange" />
</telerik:DataGridTextColumn.CellContentStyle>
</telerik:DataGridTextColumn>
<telerik:DataGridTextColumn PropertyName="OptimalValue" CanUserEdit="False"
HeaderText="Optimal">
</telerik:DataGridTextColumn>
<telerik:DataGridTextColumn PropertyName="ChemicalValue"
HeaderText="Value">
</telerik:DataGridTextColumn>
<telerik:DataGridTextColumn PropertyName="Measurement" CanUserEdit="False"
HeaderText="">
</telerik:DataGridTextColumn>
</telerik:RadDataGrid.Columns>
</telerik:RadDataGrid>
</VerticalStackLayout>
</StackLayout>
</ContentPage>
Here is my ViewModel
using FertilizerFarm.Services;
namespace FertilizerFarm.ViewModel;
[QueryProperty(nameof(LeafAnalysis), "LeafAnalysis")]
public partial class LeafAnalysisEditViewModel : BaseViewModel
{
[ObservableProperty]
LeafAnalysis leafAnalysis;
[ObservableProperty]
bool isRefreshing;
[ObservableProperty]
ObservableCollection<Land> landList;
[ObservableProperty]
Land selectedLand;
[ObservableProperty]
string headerText;
public bool Initiated { get; protected set; }
IConnectivity connectivity;
private readonly LeafAnalysisService leafService;
private readonly LandService landService;
public LeafAnalysisEditViewModel(IConnectivity connectivity, LeafAnalysisService leafService, LandService landService)
{
this.connectivity=connectivity;
this.leafService=leafService;
this.landService=landService;
Initialize = GetData();
}
public Task Initialize { get; }
private async Task GetData()
{
var lands = await landService.GetLandsForUser();
LandList = new ObservableCollection<Land>(lands);
if (LandList.Count == 0)
{
// show error
}
else
{
SelectedLand = landList[0];
LeafAnalysis = await leafService.GetNew(LandList[0].Id);
}
Initiated = true;
}
[RelayCommand]
async Task Edit()
{
if (IsBusy)
return;
}
}
If you can't replicate I will scale down our current project to demonstrate the problem.
Update Visual Studio 2022 Preview to 17.3.0 Preview 1.0.
Create a new MAUI application using the "Telerik .NET MAUI App (Preview) (Progress). (Attached).
Build the application (test done targeting "Windows Machine"; net6.0-windows10.0.19041.
Two errors will appear in the Error List window:
Severity Code Description Project File Line Suppression State
Error PRI175: 0x80073b0f - Processing Resources failed with error: Duplicate Entry. TelerikMauiApp2 <FullPathOmitted>\TelerikMauiApp2\WINAPPSDKGENERATEPROJECTPRIFILE 1
Error PRI222: 0x80073b0f - Unspecified error occurred. TelerikMauiApp2 <FullPathOmitted>\TelerikMauiApp2\WINAPPSDKGENERATEPROJECTPRIFILE 1
These errors are typically seen when some component is not at the same version as the framework. In this case, Telerik UI for .NET MAUI 0.8.0 targets RC2 according to the release notes.
Please update the global.json file in your demo application to the new Version of the .NET SDK
{
"sdk":
{
"version": "6.0.100-preview.6.21355.2",
"rollForward": "disable",
"allowPrerelease": true
}
}