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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Binding collectionviewsource to datagrid

Thread ID:





118223 Feb 12,2015 11:54 AM UTC Feb 13,2015 11:43 AM UTC WinRT 1
Tags: SfDataGrid
Asked On February 12, 2015 11:54 AM UTC


How to bind CollectionViewSource to Datagrid? Because I've tried some things but no data is displayed.


            <CollectionViewSource x:Name="SampleDataViewSource" />         

 <Grid:SfDataGrid Name="SampleGrid" Margin="0" 
                             ItemsSource="{Binding SampleDataViewSource}"                           
                    <Grid:GridTextColumn HeaderText="ID" MappingName="id" />
                    <Grid:GridTextColumn HeaderText="Customer" MappingName="name" />
                    <Grid:GridTextColumn HeaderText="Country" MappingName="country" />               

However if I bound this CollectionViewSource to GridView, data is displayed.

Thanks un advance


Mohanraj Gunasekaran [Syncfusion]
Replied On February 13, 2015 11:43 AM UTC

Hi Anna,

Thanks for contacting Syncfusion support,

We have analyzed your query and we don’t have support to bind CollectionViewSource. Instead of that, you can bind GridQueryableCollectionViewWrapper of SfDataGrid which is derived from ICollectionView. Please refer the code snippet and sample in below location.

Code snippet:

this.datagrid.ItemsSource = new GridQueryableCollectionViewWrapper(new ViewModel().Source1, this.datagrid);

Sample location: http://www.syncfusion.com/uploads/user/directTrac/118223/VeticalAlignment-1142284013.zip

If the above solution doesn’t meet your requirement, Please let us know why do you need to bind CollectionViewSource. That will help us to provide better solution.

Please let us know if you have any further assistance,




This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon