[RadDataGrid] Crash at startup with or without ItemsSource

1 Answer 175 Views
DataGrid
Sébastien
Top achievements
Rank 2
Iron
Iron
Iron
Sébastien asked on 12 Jul 2022, 02:35 AM
Hi,

Load the sample app, it generates: Error HRESULT E_FAIL has been returned from a call to a COM component.

I have the same in a UWP app and it works perfectly.

<grid:RadDataGrid
            x:Name="DataGrid"
            Grid.Row="1"
            AutoGenerateColumns="True"
            Background="#f0f0f0"
            BorderThickness="0"
            FrozenColumnCount="4"
            GridLinesThickness="1"
            GridLinesVisibility="Horizontal"
            Margin="0,16,0,0"
            SelectionMode="None"
            UserColumnReorderMode="None"
            UserFilterMode="Disabled"
            UserGroupMode="Disabled">
            <grid:RadDataGrid.Commands>
                <powerNumbers:PowerNumbersAutoGenerateCommand />
            </grid:RadDataGrid.Commands>
        </grid:RadDataGrid>

1 Answer, 1 is accepted

Sort by
0
Accepted
Lance | Senior Manager Technical Support
Telerik team
answered on 12 Jul 2022, 01:39 PM

Hi Sebastien,

Whenever you see an error like that, especially at startup and the App class throws the exception, it's almost always a XAML problem (missing XAML or incorrect XAML like a bad x:Bind).

Looking at your attached project, I see that the App class's MergedResources is missing the Telerik resources. This would explain what you're seeing because it falls under the "missing XAML" category.

To be more specific, see step 5 here => First Steps | Telerik UI for WinUI. Once you add the 1-liner to your App resources, it should work as expected.

Let me know how it goes.

Regards,
Lance | Manager Technical Support
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Sébastien
Top achievements
Rank 2
Iron
Iron
Iron
commented on 12 Jul 2022, 01:47 PM

Hi,

It does fix the crash, thank you! Interesting that the Chart was working well without the resource defined in App.xml.

The output of the DataGrid differs versus UWP. I will take a closer look and report back if I don't see anything.

Thank you
Sébastien

Lance | Senior Manager Technical Support
Telerik team
commented on 12 Jul 2022, 02:22 PM

Awesome! Yeah, the chart is one of those controls that don't lean on XAML styles for rendering (it's canvas-based).

In UWP, there's a built-in platform mechanism for us to load our styles for you while still allowing for overridable resource keys, this doesn't exist (yet) for WinUI3.

Tags
DataGrid
Asked by
Sébastien
Top achievements
Rank 2
Iron
Iron
Iron
Answers by
Lance | Senior Manager Technical Support
Telerik team
Share this question
or