I have been using SfDataGrid in which I am using different type of bindings. There are converters, multi-binding and regular bindings with some GridComboBoxColumn,GridHyperlinkColumn and Template Columns. When i serialize my datagrid, everything seems ok. But when i deserialize it, some of my fields just wont bind. Instead there are filled with EntityFramework dynamic proxies. I attach an image of my SfDataGrid after deserialization. Below you can find xaml binding of the datagrid.
Thanks.
<syncfusion:SfDataGrid
Name="sfDataGrid"
Grid.Row="2"
AllowResizingColumns="True"
ShowGroupDropArea="True"
GroupDropAreaText="Alan gruplandirmalari için kolonlari sürükle ve birak"
AllowFiltering="True"
EditTrigger="OnDoubleTap"
ItemsSource="{Binding Datasheetcontents,UpdateSourceTrigger=PropertyChanged}"
AutoGenerateColumns="False"
SelectedItem="{Binding SelectedDataSheetContent,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}"
AllowDeleting="False"
AllowDraggingColumns="True"
AllowGrouping="True"
ShowColumnWhenGrouped="True"
AddNewRowPosition="None"
SelectionMode="Extended"
RowValidated="sfDataGrid_RowValidated"
SelectionChanged="sfDataGrid_SelectionChanged"
GridContextMenuOpening="sfDataGrid_GridContextMenuOpening">
<syncfusion:SfDataGrid.RecordContextMenu>
<ContextMenu>
<MenuItem Header="Sirayla Doldur" Click="MenuItem_Click" />
<MenuItem x:Name="meenuItemIcerik" Header="Içerik Sil" Click="menuItemIcerik_Click" />
</ContextMenu>
</syncfusion:SfDataGrid.RecordContextMenu>
<syncfusion:SfDataGrid.Columns>
<syncfusion:GridTextColumn HeaderText="AktiviteKodu" MappingName="budgetcode.activity.kod" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Bütçe Kodu" MappingName="budgetcodes_id" ValueBinding="{Binding budgetcodes_id,Converter={StaticResource BCConverter}}" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Bütçe Lokasyon Kodu" MappingName="budgetcode.locationcode.kod" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Imalat Grubu" MappingName="budgetcode.activity.imalatgrubu" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Ana Aktivite" MappingName="budgetcode.activity.anaaktivite" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Alt Aktivite" MappingName="budgetcode.activity.detay" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Birim" MappingName="budgetcode.activity.birim" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Ihale Kodu" MappingName="ihale_kod" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Bina Bölgesi/Etap" MappingName="etap" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Açiklama" MappingName="aciklama" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Mahal" MappingName="mahal" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Kat" MappingName="kat" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Kot" MappingName="kot" AllowEditing="True"></syncfusion:GridTextColumn>
<syncfusion:GridNumericColumn HeaderText="Yükseklik" MappingName="yukseklik" AllowEditing="True"></syncfusion:GridNumericColumn>
<syncfusion:GridNumericColumn HeaderText="Alan" MappingName="alan" AllowEditing="True"></syncfusion:GridNumericColumn>
<syncfusion:GridNumericColumn HeaderText="Çevre" MappingName="cevre" AllowEditing="True"></syncfusion:GridNumericColumn>
<syncfusion:GridNumericColumn HeaderText="Metraj" MappingName="metraj" AllowEditing="True"></syncfusion:GridNumericColumn>
<syncfusion:GridDateTimeColumn HeaderText="Baslangiç" ValueBinding="{Binding baslangic,UpdateSourceTrigger=PropertyChanged}" MappingName="baslangic" CustomPattern="dd.mm.yyyy" AllowEditing="True" AllowNullValue="True" NullText=""></syncfusion:GridDateTimeColumn>
<syncfusion:GridDateTimeColumn HeaderText="Bitis" ValueBinding="{Binding bitis,UpdateSourceTrigger=PropertyChanged}" MappingName="bitis" CustomPattern="dd.mm.yyyy" AllowEditing="True" AllowNullValue="True" NullText=" "></syncfusion:GridDateTimeColumn>
<syncfusion:GridComboBoxColumn HeaderText="Dagilim" ItemsSource="{Binding Distributions,UpdateSourceTrigger=PropertyChanged}" MappingName="distributions_id" SelectedValuePath="id" DisplayMemberPath="ad" AllowEditing="True"></syncfusion:GridComboBoxColumn>
<syncfusion:GridNumericColumn HeaderText="Bütçe Metraj" MappingName="metraj_budget" AllowEditing="True"></syncfusion:GridNumericColumn>
<syncfusion:GridHyperlinkColumn HeaderText="Fiyat" MappingName="." ValueBinding="{Binding .,Converter={StaticResource UnitPriceConverter}}" AllowEditing="False">
<syncfusion:GridHyperlinkColumn.CellStyle>
<Style>
<Style.Resources>
<Style TargetType="Hyperlink">
<Setter Property="ToolTip" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.fiyat_tooltip}"></Setter>
<Setter Property="Foreground" Value="{Binding price_type,Converter={StaticResource UnitPriceColorConverter}}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.Show_Prices}"></Setter>
</Style>
</Style.Resources>
</Style>
</syncfusion:GridHyperlinkColumn.CellStyle>
</syncfusion:GridHyperlinkColumn>
<syncfusion:GridNumericColumn HeaderText="Birim Fiyat" MappingName="." AllowEditing="False" ValueBinding="{Binding .,Converter={StaticResource CurrenyConverterFiyat}}"></syncfusion:GridNumericColumn>
<syncfusion:GridTextColumn HeaderText="Birim Poz" AllowEditing="False" MappingName=".">
<syncfusion:GridTextColumn.ValueBinding>
<MultiBinding Converter="{StaticResource ConverterDSC}">
<Binding Source="{StaticResource STR_poz}" />
<Binding Path="." />
</MultiBinding>
</syncfusion:GridTextColumn.ValueBinding>
</syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Kapsam" AllowEditing="False" MappingName=".">
<syncfusion:GridTextColumn.ValueBinding>
<MultiBinding Converter="{StaticResource ConverterDSC}">
<Binding Source="{StaticResource STR_kapsam}" />
<Binding Path="." />
</MultiBinding>
</syncfusion:GridTextColumn.ValueBinding>
</syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Analiz Tipi" AllowEditing="False" MappingName=".">
<syncfusion:GridTextColumn.ValueBinding>
<MultiBinding Converter="{StaticResource ConverterDSC}">
<Binding Source="{StaticResource STR_analiztip}" />
<Binding Path="." />
</MultiBinding>
</syncfusion:GridTextColumn.ValueBinding>
</syncfusion:GridTextColumn>
<syncfusion:GridNumericColumn HeaderText="Tutar" MappingName="." AllowEditing="False" ValueBinding="{Binding .,Converter={StaticResource CurrenyConverterTutar}}"></syncfusion:GridNumericColumn>
<syncfusion:GridTemplateColumn HeaderText="Firma" MappingName="subcontractors_id" AllowEditing="True">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding subcontractor.ad}"></TextBlock>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.FilteredSubcontractors}" DisplayMemberPath="ad" SelectedValuePath="id" SelectedValue="{Binding subcontractors_id}"></ComboBox>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTemplateColumn HeaderText="Sözlesme No" MappingName="contracts_id" AllowEditing="True">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding contract.sozlesme_no}"></TextBlock>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.FilteredContracts}" DisplayMemberPath="sozlesme_no" SelectedValuePath="id" SelectedValue="{Binding contracts_id}"></ComboBox>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTemplateColumn HeaderText="Ihale Paketi" MappingName="tenderpackages_id" AllowEditing="True">
<syncfusion:GridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding tenderpackage.ad}"></TextBlock>
</DataTemplate>
</syncfusion:GridTemplateColumn.CellTemplate>
<syncfusion:GridTemplateColumn.EditTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type UserControl}}, Path=DataContext.TenderPackages}" DisplayMemberPath="ad" SelectedValuePath="id" SelectedValue="{Binding tenderpackages_id}"></ComboBox>
</DataTemplate>
</syncfusion:GridTemplateColumn.EditTemplate>
</syncfusion:GridTemplateColumn>
<syncfusion:GridTextColumn HeaderText="Fiyat Tip" MappingName="price_type" AllowEditing="False"></syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="Fiyat ID" MappingName="." AllowEditing="False">
<syncfusion:GridTextColumn.ValueBinding>
<MultiBinding Converter="{StaticResource ConverterDSC}">
<Binding Source="{StaticResource STR_fiyatid}" />
<Binding Path="." />
</MultiBinding>
</syncfusion:GridTextColumn.ValueBinding>
</syncfusion:GridTextColumn>
<syncfusion:GridTextColumn HeaderText="ID" MappingName="id"></syncfusion:GridTextColumn>
<syncfusion:GridHyperlinkColumn HeaderText="Içerik" MappingName="contentfile" ValueBinding="{Binding contentfile,Converter={StaticResource IcerikConverter}}" AllowEditing="False">
<syncfusion:GridHyperlinkColumn.CellStyle>
<Style>
<Style.Resources>
<Style TargetType="Hyperlink">
<Setter Property="Foreground" Value="{Binding contentfile,Converter={StaticResource IcerikColorConverter}}"></Setter>
<Setter Property="Command" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type UserControl}},Path=DataContext.Manage_Icerik}"></Setter>
</Style>
</Style.Resources>
</Style>
</syncfusion:GridHyperlinkColumn.CellStyle>
</syncfusion:GridHyperlinkColumn>
</syncfusion:SfDataGrid.Columns>
</syncfusion:SfDataGrid>