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

GridDataControl and SFDataGrid fail together

When I add a reference to Syncfusion.SFGrid.WPF.dll in an existing project that has a GridDataControl, I get this error -

{"Cannot add instance of type 'GridDataGroupColumn' to a collection of type 'FreezableCollection`1'. Only items of type 'T' are allowed."}


If I remove the grouped columns, it will run but my SFDataGrid does not render.
I have to remove the reference to the Syncfusion.SFGrid.WPF assembly for the GridDataControl to work correctly.

Can these controls be used in the same project?

Thanks!

1 Reply

FP Farjana Parveen Ayubb Syncfusion Team October 20, 2014 01:51 PM UTC

Hi Jeremy,

 

Thank you for contacting Syncfusion support.

We have analyzed your query. We are able to use GridDataControl and SfDataGrid in same application. We are having GridGroupColumn in Syncfusion.UI.Xaml.Grid (present in Syncfusion.SfGrid.Wpf.dll) and also Syncfusion.Windows.Control.Grid (Present in Syncfusion.Grid.Wpf.dll) namespaces. And both namespaces are added to the below schema “http://schemas.syncfusion.com/wpf”. The provided application refer to both Syncfusion.Grid.Wpf.dll and also Syncfusion.SfGrid.Wpf.dll. So that only its shows errors ” {"Cannot add instance of type 'GridDataGroupColumn' to a collection of type 'FreezableCollection`1'. Only items of type 'T' are allowed."}”. So, you can define schema like in the below code instead of using default schema definition of syncfusion to overcome this problem,


Please refer the below code snippet and sample in the following location:

 

Code Snippet:

xmlns:sync="clr-namespace:Syncfusion.UI.Xaml.Grid;assembly=Syncfusion.SfGrid.WPF"

xmlns:sncg="clr-namespace:Syncfusion.Windows.Controls.Grid;assembly=Syncfusion.Grid.WPF"

 

 

 

Regards,

Farjana Parveen A


Attachment: GDCSf_Sample_7000699f.zip

Loader.
Up arrow icon