We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfDatagrid crash after open in a Secondary Window

Hello! 
I'm working with SfDataGrid It was working very good but with my new requirement I have to show the control in a new Window (Secondary Window) The first time I open the window the control works very well after I close the Window after I Open the Window again and I have this error from the control.

System.Runtime.InteropServices.COMException: Error HRESULT E_FAIL has been returned from a call to a COM component.
   at Windows.UI.Xaml.UIElement.Measure(Size availableSize)
   at Syncfusion.UI.Xaml.Grid.DataRowBase.MeasureElement(Size size)
   at Syncfusion.UI.Xaml.Grid.VisualContainer.MeasureRows()
   at Syncfusion.UI.Xaml.Grid.VisualContainer.MeasureOverride(Size constraint)

this is the code of my XAML

    <my:SfDataGrid
                AutoGenerateColumns="False"
                BorderBrush="Black"
                BorderThickness="1,0,0,0"
                ItemsSource="{Binding Appraisals, Mode=TwoWay}">
                <my:SfDataGrid.Resources>
                    <Style TargetType="TextBlock">
                        <Setter Property="FontSize" Value="12" />
                    </Style>
                </my:SfDataGrid.Resources>
                <my:SfDataGrid.Columns>
                    <my:GridTextColumn
                        Width="60"
                        DisplayBinding="{Binding InternalIdentifier}"
                        HeaderText="Id"
                        TextAlignment="Center" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding ProductName}"
                        HeaderText="Tipo de avalúo"
                        TextAlignment="Left"
                        TextTrimming="WordEllipsis" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding Client}"
                        HeaderText="Cliente" />
                    <my:GridTextColumn
                        Width="130"
                        DisplayBinding="{Binding TypeOfPropertyName}"
                        HeaderText="Tipo de inmueble"
                        TextAlignment="Center" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding ControllerName}"
                        HeaderText="Controlador" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding ValuerName}"
                        HeaderText="Valuador" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding OwnerName}"
                        HeaderText="Propietario" />
                    <my:GridTextColumn
                        Width="150"
                        DisplayBinding="{Binding ApplicantName}"
                        HeaderText="Solicitante" />
                    <my:GridTextColumn
                        Width="100"
                        DisplayBinding="{Binding FinishDate}"
                        HeaderText="Fecha"
                        TextAlignment="Center" />
                    <my:GridTemplateColumn
                        Width="80"
                        HorizontalAlignment="Center"
                        AllowSorting="False"
                        HeaderText=" "
                        MappingName="Imprimir">
                        <my:GridTemplateColumn.CellTemplate>
                            <DataTemplate>
                                <AppBarButton
                                    HorizontalAlignment="Stretch"
                                    VerticalAlignment="Stretch"
                                    Icon="More">
                                    <AppBarButton.Flyout>
                                        <MenuFlyout>
                                            <MenuFlyoutItem
                                                Command="{Binding DataContext.CloneAppraisalCommand, ElementName=MainPage}"
                                                CommandParameter="{Binding}"
                                                Text="Duplicar" />
                                            <MenuFlyoutItem
                                                Command="{Binding DataContext.PrintAppraisalCommand, ElementName=MainPage}"
                                                CommandParameter="{Binding}"
                                                Text="Imprimir" />
                                        </MenuFlyout>
                                    </AppBarButton.Flyout>
                                </AppBarButton>
                            </DataTemplate>
                        </my:GridTemplateColumn.CellTemplate>
                    </my:GridTemplateColumn>
                </my:SfDataGrid.Columns>
            </my:SfDataGrid>

I hope anyone could help me.

Thank you!

1 Reply

BR Balamurugan Rajaraman Syncfusion Team April 21, 2017 01:28 PM UTC

Hi Ricardo 

Thank you for contact Syncfusion support. 

We have analyzed your query “Crashes while tried to load the SfDataGrid in Secondary window”. We are not able to reproduce the reported issue, it’s working fine in our side. We have attached the tested sample for your reference. Could you please revert us by modifying the sample to reported issue in our side. It will greatly helpful for us to analyze further. 

You can able to download the tested sample from the below link 


Regards, 
Balamurugan R 


Loader.
Up arrow icon