DataGrid for .NET MAUI

Hello

It would be great if there was some estimated timeline for the DataGrid control in the roadmap for .NET MAUI


22 Replies

AL Alain May 20, 2022 06:53 PM UTC

I second that



SV Suja Venkatesan Syncfusion Team May 24, 2022 05:09 AM UTC

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



AN Andreas June 9, 2022 04:06 AM UTC

looking forward to have this available soon.



RS Ruba Shanmugam Syncfusion Team June 9, 2022 06:10 AM UTC

Hi Krishna,


Thanks for the update. Please let us know if you need any other details.


Regards,

Ruba Shanmugam



SV Suja Venkatesan Syncfusion Team July 6, 2022 06:26 AM UTC

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.


https://www.syncfusion.com/forums/175975/essential-studio-2022-volume-2-main-release-v20-2-0-36-is-available-for-download


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




KP Krishna Prasad replied to Suja Venkatesan July 6, 2022 11:08 AM UTC

Awesome Suja!


will be downloading and trying it out!.



RS Ruba Shanmugam Syncfusion Team July 8, 2022 04:08 AM UTC

Hi Krishna,


Thanks for the update. Please let us know if you need any other details.


Regards,

Ruba Shanmugam



JC jose candido July 14, 2022 12:20 AM UTC

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

        }

    }

}





KK Karthikraja Kalaimani Syncfusion Team July 14, 2022 09:10 AM UTC

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


Attachment: GettingStarted_b6dd85f3.zip


JC jose candido replied to Karthikraja Kalaimani July 14, 2022 03:49 PM UTC

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



Attachment: MainPage_231a337b.zip


KK Karthikraja Kalaimani Syncfusion Team July 15, 2022 01:06 PM UTC

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, 

https://www.syncfusion.com/feedback/36287/exception-is-raised-when-layout-the-datagrid-inside-the-stacklayout 

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



KK Karthikraja Kalaimani Syncfusion Team July 18, 2022 01:38 PM UTC

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.


Regards,
Karthik Raja


KK Karthikraja Kalaimani Syncfusion Team July 19, 2022 01:04 PM UTC

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.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.


Regards,

Karthik Raja



KK Karthikraja Kalaimani Syncfusion Team July 27, 2022 04:56 AM UTC

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/).   


https://www.syncfusion.com/feedback/36401/windows-exception-is-thrown-when-itemssource-property-is-not-set

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



AN Andreas July 27, 2022 09:18 AM UTC

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. 





KK Karthikraja Kalaimani Syncfusion Team July 28, 2022 09:26 AM UTC

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.


  1. Install CommunityToolKit.Maui and CommunityToolKit.Maui.Markup packages from (nuget.org).

  2. 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 x:Name="dataGrid" SelectionMode="Single"  ItemsSource="{Binding OrderInfoCollection}">

        <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.

https://github.com/MicrosoftDocs/CommunityToolkit/blob/main/docs/maui/behaviors/event-to-command-behavior.md


Regards,
Karthik Raja


Attachment: GettingStarted_b805f991.zip


JC jose candido replied to Karthikraja Kalaimani July 28, 2022 10:57 AM UTC

Hi Karthik Raja .

Thank you for the feedback and the quick work!


Hope you have a wonderful day!



KK Karthikraja Kalaimani Syncfusion Team July 29, 2022 05:57 AM UTC

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



DS Digital Skills August 13, 2024 11:11 AM UTC

Hello,

Will DataGrid in Maui support child rows?



SD Sethupathy Devarajan Syncfusion Team August 14, 2024 01:13 PM UTC

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 link40168

 

If your expectations differ, please provide additional details to help us better understand your requirements.

 

Regards,

Sethupathy D.




UM Umesh October 30, 2024 12:08 AM UTC

DataGrid shows data on windows version but same codes when run on mac it shows blank screen. attached is screenshot and sample codes.


Attachment: image_2024_10_29T23_46_03_544Z_(2)_79fc1f51.zip


SD Sethupathy Devarajan Syncfusion Team October 30, 2024 07:13 AM UTC

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.


Loader.
Up arrow icon