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!