Hello
It would be great if there was some estimated timeline for the DataGrid control in the roadmap for .NET MAUI
I second that
Hi Krishna,
We would like to inform you that SfDataGrid in .Net MAUI will be available from the 2022 Volume 2 Main release, which is scheduled for the end of June 2022. Please let us know if you need any further assistance.
Regards,
Suja
looking forward to have this available soon.
Hi Krishna,
Thanks for the update. Please let us know if you need any other details.
Regards,
Ruba Shanmugam
Hi,
We are glad to announce that our Essential Studio 2022 Volume 2 main release v20.2.0.36 is rolled out and SfDataGrid control is included in this version v20.2.0.36 which is available for download under the following link.
UG: https://help.syncfusion.com/maui/datagrid/overview
We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.
Regards,
Suja
Awesome Suja!
will be downloading and trying it out!.
Hi Krishna,
Thanks for the update. Please let us know if you need any other details.
Regards,
Ruba Shanmugam
Hi, i coun't make it work, i folowed all the instructions on the getting started page for the data grid and when i run the app it just set a break point and open a file
#pragma checksum "C:\Users\user\Desktop\C sharp Biblioteca\APPS\SPT\SPT\Platforms\Windows\App.xaml" "{8829d00f-11b8-4213-878b-770e8597ac16}" "FFEF0E6FD95328B59DE6661ED09627D1AA85C5ED28B32E418AD706EA80831573"
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace SPT.WinUI
{
#if !DISABLE_XAML_GENERATED_MAIN
/// <summary>
/// Program class
/// </summary>
public static class Program
{
[global::System.Runtime.InteropServices.DllImport("Microsoft.ui.xaml.dll")]
private static extern void XamlCheckProcessRequirements();
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler"," 1.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.STAThreadAttribute]
static void Main(string[] args)
{
XamlCheckProcessRequirements();
global::WinRT.ComWrappersSupport.InitializeComWrappers();
global::Microsoft.UI.Xaml.Application.Start((p) => {
var context = new global::Microsoft.UI.Dispatching.DispatcherQueueSynchronizationContext(global::Microsoft.UI.Dispatching.DispatcherQueue.GetForCurrentThread());
global::System.Threading.SynchronizationContext.SetSynchronizationContext(context);
new App();
});
}
}
#endif
partial class App : global::Microsoft.Maui.MauiWinUIApplication
{
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler"," 1.0.0.0")]
private bool _contentLoaded;
/// <summary>
/// InitializeComponent()
/// </summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.UI.Xaml.Markup.Compiler"," 1.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
public void InitializeComponent()
{
if (_contentLoaded)
return;
_contentLoaded = true;
global::System.Uri resourceLocator = new global::System.Uri("ms-appx:///Platforms/Windows/App.xaml");
global::Microsoft.UI.Xaml.Application.LoadComponent(this, resourceLocator);
#if DEBUG && !DISABLE_XAML_GENERATED_BINDING_DEBUG_OUTPUT
DebugSettings.BindingFailed += (sender, args) =>
{
global::System.Diagnostics.Debug.WriteLine(args.Message);
};
#endif
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
}
}
}
Hi Jose,
We have checked the sample which is linked in Getting Started page
and the sample is running successfully without any exceptions in WinUI platform
on our end. We suspect that you might be missed to register the handler for DataGrid. If not, please implement the below highlighted code snippets to register
handler for DataGrid in MauiProgram class.
We have tested in Visual Studio 2022 Preview 2.0 IDE.
|
using Syncfusion.Maui.DataGrid.Hosting; using Syncfusion.Maui.Core.Hosting; public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); });
builder.ConfigureSyncfusionCore(); builder.ConfigureSyncfusionDataGrid(); return builder.Build(); } } |
The sample we have
used to check the reported issue available in the attachment. Please have a
look at this sample and let us know if missed any customization you have done
in your application or revert us with below requested details.
· Share modified sample or both XAML and C# code snippets related to SfDataGrid to replicate the reported issue.
· Share exception name with stackstrace.
· Share MAUI SfDataGrid version.
· Share Visual Studio version.
Regards,
Karthik Raja
Hi i still get the same error.
attached the requested files .
SfDataGrid version : 20.2.36.
Visual Studio version: 17.3.0 Preview 3.0
Hi Jose,
We have known issue "InteropServices.ComException” exception thrown when loading DataGrid to the children of Layouts which are giving infinity height and width in all platforms. Right now, we have fixed all layouts-based issues with ItemSource initialized and you can expect this fix from the upcoming weekly NuGet which is available on 19th July 2022.
You can track the status of this report through the following feedback link,
Note: The feedback link provided is private, you need to login to view this feedback.
Currently, we are validating the issue "layouts-based issue without ItemSource initialize" and we will validate and update further details on 18th July 2022. Until then, please set the DataGrid with the required height request and set the ItemsSource property to DataGrid to overcome the issue temporarily. We appreciate your patience until then.
Regards,
Karthik Raja
Hi Jose,
We have logged an issue report for the issue "Exception is thrown when the ItemSource property is not set". We will fix the issue and include the fix in our next Weekly Nuget release update which is planned to roll out on 26thJuly2022. We appreciate your patience until then.
You can track the status of this report through the following feedback link,
Note: The feedback link provided is private, you need to login to view this feedback.
We have fixed the reported issue “Exception is raised when layout the DataGrid from Layout controls which returns infinity height request” and included the issue fix in our latest weekly nuget release (v20.2.0.39) which is available for download (https://www.nuget.org/).
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.
Karthik Raja
Hi Jose,
We have fixed the reported issue “Exception is raised when
layout the DataGrid from Layout controls which returns infinity height request”
and included the issue fix in our latest weekly nuget release (v20.2.0.40)
which is available for download (https://www.nuget.org/).
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you require any further assistance.
Regards,
Karthik Raja
How can I make the "SelectionChanged" Event from the DataGrid to accept MVVM IRelayCommands ?
ViewModel ICommand using CommunityToolkit.Mvvm
[ICommand]
private void YearSelectionChanged(DataGridSelectionChangedEventArgs args)
{
}
<datagrid:SfDataGrid AutoGenerateColumnsMode="None"
ItemsSource="{Binding Grid1YHistoryData}"
HorizontalOptions="FillAndExpand"
NavigationMode="Row"
SelectionMode="Single"
SelectionChanged="{Binding YearSelectionChangedCommand}">
I get 2 errors:
Error XLS0523 Event 'SelectionChanged' can only be bound to properties of delegate type 'EventHandler`1'.
Error XFC0009 No property, BindableProperty, or event found for "SelectionChanged", or mismatching type between value and property.
Hi Andreas,
DataGrid does not have support to bind the event
to command. You can achieve this by using the CommunityToolkit.Maui nuget and it provides the support for EventToCommandBehavior option. Please follow the below steps to
bind the SelectionChanged event to command.
Install CommunityToolKit.Maui and CommunityToolKit.Maui.Markup packages from (nuget.org).
Register CommunityToolKit and CommunityToolKitMarkup on MauiProgram.cs. Please refer to the below code snippets.
|
using CommunityToolkit.Maui.Markup; using Syncfusion.Maui.DataGrid.Hosting; using Syncfusion.Maui.Core.Hosting; using CommunityToolkit.Maui;
public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiCommunityToolkit() .UseMauiCommunityToolkitMarkup() .UseMauiApp<App>() .ConfigureFonts(fonts => { fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); });
builder.ConfigureSyncfusionCore(); builder.ConfigureSyncfusionDataGrid(); return builder.Build(); } } |
iii) Write EventToCommandBehavior for SelectionChanged event of DataGrid. Please refer to the below code snippets.
|
<ContentPage.Resources> <ResourceDictionary> <local:SelectedItemEventArgsConverter x:Key="selectedItemEventargsConverter" /> </ResourceDictionary> </ContentPage.Resources> <syncfusion:SfDataGrid.Behaviors> <toolkit:EventToCommandBehavior EventName="SelectionChanged" EventArgsConverter="{StaticResource selectedItemEventargsConverter}" Command="{Binding GridSelectionCommand}" >
</toolkit:EventToCommandBehavior> </syncfusion:SfDataGrid.Behaviors>
</syncfusion:SfDataGrid> |
iv) Write Converter for EventArgsConverter to get event arguments. Please, refer to the below code snippets.
|
public class SelectedItemEventArgsConverter : ICommunityToolkitValueConverter { public Type FromType => throw new NotImplementedException();
public Type ToType => throw new NotImplementedException();
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return value; }
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{ throw new NotImplementedException(); } }
//ViewModel public ICommand GridSelectionCommand { get; set; } ….. GridSelectionCommand = new Command((object obj) => SelectionCommandExecute(obj));
…..
public void SelectionCommandExecute(object obj) { var selectedItem = ((obj as Syncfusion.Maui.DataGrid.DataGridSelectionChangedEventArgs).AddedRows[0] as OrderInfo); }
|
Please refer to the below document to know about EventToCommandBehavior.
Regards,
Karthik Raja
Hi Karthik Raja .
Thank you for the feedback and the quick work!
Hope you have a wonderful day!
Hi Jose,
We are glad that the reported issue has been resolved at your end.
Please let us know if you require any additional assistance. As always, we are happy to assist you.
Regards,
Karthik Raja
Hello,
Will DataGrid in Maui support child rows?
Hi Digital Skills,
Query | Response |
DataGrid in Maui support child rows? | Based on the information provided, we are uncertain about your query. If your requirement is to have a Master-Detail view, we have already logged it as a feature request. It will be considered for implementation in one of our upcoming releases. During the planning phase of each release cycle, we evaluate all pending features and select those for implementation based on several criteria, including product vision, technological feasibility, and customer demand. We appreciate your patience and understanding during this process. For further details, please refer to the feedback below.
Feedback link: 40168
If your expectations differ, please provide additional details to help us better understand your requirements. |
Regards,
Sethupathy D.
DataGrid shows data on windows version but same codes when run on mac it shows blank screen. attached is screenshot and sample codes.
Hi Umesh ,
You have already created the same query in the forum under your ID, so you can follow the response for this there.
Regards,
Sethupathy D.