tags:

views:

37

answers:

1

I have a datagrid column whose column values are databinded. I have used DataGridTemplateColumn and i need to use the sorting in this column.

my:DataGridTemplateColumn SortMemberPath="FileName" Header="Name" IsReadOnly="True" MinWidth="150"

It works and sort the the data but when i edit the data after sorting, i need to re-generate the columns data.

FileListingGrid.ItemsSource = listFiles1;

But this generates "'Sorting' is not allowed during an AddNew or EditItem transaction. "

It works file when column data is not sorted but whenever i sort the data and have to re-generate the column data, it throws the following error.

A: 

Can you use CollectionViewSource and specify your SortMemberPath(in your case 'FileName') as the SortDescription?

bjoshi