Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Datagrid not working on Windows #3

Open
HodrojHsen opened this issue Nov 12, 2022 · 1 comment
Open

Datagrid not working on Windows #3

HodrojHsen opened this issue Nov 12, 2022 · 1 comment

Comments

@HodrojHsen
Copy link

Error when columns exists

wen running on windows the app breaks and debugger goes to the bellow point in file App.g.i.cs:

#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
            UnhandledException += (sender, e) =>
            {
                if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
            };
#endif
        }

when adding any column manually or setting the AutoGenerateColumnsMode to any value other than "None" the error occurred,
and when setting to "None" without adding any column, then no error.
Note: the app is working on android with no error.

@mglochsen
Copy link

I can confirm this problem an can add some more details.

Syncfusion Version: 23.1.42
Maui Version: 8.0.0-rc.2.9373

XAML:

<datagrid:SfDataGrid AutoGenerateColumnsMode="None"
                     ItemsSource="{Binding Locations}">
    <datagrid:SfDataGrid.Columns>
        <datagrid:DataGridTextColumn MappingName="Name" HeaderText="Name" />
    </datagrid:SfDataGrid.Columns>
</datagrid:SfDataGrid>

Exception Message:

Unable to cast object of type 'System.Collections.Generic.Dictionary2[Microsoft.Maui.Controls.BindableProperty,System.ValueTuple2[System.String,Microsoft.Maui.Controls.SetterSpecificity]]' to type 'System.Collections.Generic.Dictionary`2[Microsoft.Maui.Controls.BindableProperty,System.String]'.

Stacktrace:

at Syncfusion.Maui.DataGrid.DataGridRow.get_ImplicitDataGridRowStyle()
at Syncfusion.Maui.DataGrid.DataRow.ApplyRowStyle()
at Syncfusion.Maui.DataGrid.DataGridRow.OnParentSet()
at Microsoft.Maui.Controls.Element.SetParent(Element value)
at Microsoft.Maui.Controls.Element.OnChildAdded(Element child)
at Microsoft.Maui.Controls.VisualElement.OnChildAdded(Element child)
at Syncfusion.Maui.Core.SfView.System.Collections.Generic.ICollection<Microsoft.Maui.IView>.Add(IView child)
at Syncfusion.Maui.DataGrid.VisualContainer.EnsureItems(Boolean needToRefresh)
at Syncfusion.Maui.DataGrid.VisualContainer.MeasureContent(Double widthConstraint, Double heightConstraint)
at Syncfusion.Maui.Core.SfView.Microsoft.Maui.ILayout.CrossPlatformMeasure(Double widthConstraint, Double heightConstraint)
at Syncfusion.Maui.Core.Platform.LayoutPanelExt.MeasureOverride(Size availableSize)
at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.MeasureOverride(Size availableSize)
at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_MeasureOverride_0(IntPtr thisPtr, Size availableSize, Size* result)
--- End of stack trace from previous location ---
at WinRT.ExceptionHelpers.g__Throw|20_0(Int32 hr)
at ABI.Microsoft.UI.Xaml.IUIElementMethods.Measure(IObjectReference _obj, Size availableSize)
at Microsoft.UI.Xaml.UIElement.Measure(Size availableSize)
at Microsoft.Maui.ViewHandlerExtensions.GetDesiredSizeFromHandler(IViewHandler viewHandler, Double widthConstraint, Double heightConstraint)
at Microsoft.Maui.Handlers.ViewHandler2.GetDesiredSize(Double widthConstraint, Double heightConstraint) at Microsoft.Maui.Layouts.LayoutExtensions.ComputeDesiredSize(IView view, Double widthConstraint, Double heightConstraint) at Microsoft.Maui.Controls.VisualElement.MeasureOverride(Double widthConstraint, Double heightConstraint) at Syncfusion.Maui.Core.SfView.MeasureOverride(Double widthConstraint, Double heightConstraint) at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Measure(Double widthConstraint, Double heightConstraint) at Syncfusion.Maui.DataGrid.DataGridScrollView.OnPropertyChanged(String propertyName) at Microsoft.Maui.Controls.BindableObject.SetValueActual(BindableProperty property, BindablePropertyContext context, Object value, Boolean currentlyApplying, SetValueFlags attributes, SetterSpecificity specificity, Boolean silent) at Microsoft.Maui.Controls.BindableObject.SetValueCore(BindableProperty property, Object value, SetValueFlags attributes, SetValuePrivateFlags privateAttributes, SetterSpecificity specificity) at Microsoft.Maui.Controls.BindableObject.SetValue(BindablePropertyKey propertyKey, Object value) at Microsoft.Maui.Controls.VisualElement.set_Height(Double value) at Microsoft.Maui.Controls.VisualElement.UpdateBoundsComponents(Rect bounds) at Microsoft.Maui.Controls.VisualElement.set_Frame(Rect value) at Microsoft.Maui.Controls.ScrollView.ArrangeOverride(Rect bounds) at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds) at Syncfusion.Maui.DataGrid.SfDataGrid.ArrangeContent(Rect bounds) at Syncfusion.Maui.Core.SfView.Microsoft.Maui.ILayout.CrossPlatformArrange(Rect bounds) at Syncfusion.Maui.Core.Platform.LayoutPanelExt.ArrangeOverride(Size finalSize) at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize) at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result) --- End of stack trace from previous location --- at WinRT.ExceptionHelpers.<ThrowExceptionForHR>g__Throw|20_0(Int32 hr) at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect) at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect) at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect) at Microsoft.Maui.Handlers.ViewHandler2.PlatformArrange(Rect rect)
at Microsoft.Maui.Controls.VisualElement.ArrangeOverride(Rect bounds)
at Syncfusion.Maui.Core.SfView.ArrangeOverride(Rect bounds)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
at Microsoft.Maui.Layouts.GridLayoutManager.ArrangeChildren(Rect bounds)
at Microsoft.Maui.Controls.Layout.CrossPlatformArrange(Rect bounds)
at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
at Microsoft.Maui.Platform.LayoutPanel.ArrangeOverride(Size finalSize)
at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)
--- End of stack trace from previous location ---
at WinRT.ExceptionHelpers.g__Throw|20_0(Int32 hr)
at ABI.Microsoft.UI.Xaml.IUIElementMethods.Arrange(IObjectReference _obj, Rect finalRect)
at Microsoft.UI.Xaml.UIElement.Arrange(Rect finalRect)
at Microsoft.Maui.ViewHandlerExtensions.PlatformArrangeHandler(IViewHandler viewHandler, Rect rect)
at Microsoft.Maui.Handlers.ViewHandler`2.PlatformArrange(Rect rect)
at Microsoft.Maui.Controls.VisualElement.ArrangeOverride(Rect bounds)
at Microsoft.Maui.Controls.VisualElement.Microsoft.Maui.IView.Arrange(Rect bounds)
at Microsoft.Maui.Layouts.LayoutExtensions.ArrangeContent(IContentView contentView, Rect bounds)
at Microsoft.Maui.Controls.ContentPage.Microsoft.Maui.ICrossPlatformLayout.CrossPlatformArrange(Rect bounds)
at Microsoft.Maui.Platform.MauiPanel.CrossPlatformArrange(Rect bounds)
at Microsoft.Maui.Platform.MauiPanel.ArrangeOverride(Size finalSize)
at Microsoft.Maui.Platform.ContentPanel.ArrangeOverride(Size finalSize)
at Microsoft.UI.Xaml.FrameworkElement.Microsoft.UI.Xaml.IFrameworkElementOverrides.ArrangeOverride(Size finalSize)
at ABI.Microsoft.UI.Xaml.IFrameworkElementOverrides.Do_Abi_ArrangeOverride_1(IntPtr thisPtr, Size finalSize, Size* result)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants