cannot edit cell in datagrid WPF

I've a DataGrid in my view binded to an ObservableCollection<>. The binding works.

The problem is that I cannot edit any cell and don't understand why...

Here is my XAML :

<DataGrid ItemsSource="{Binding ClientSpecifications, Mode=TwoWay}" />

Only this. Nothing more. But it doesn't work. I'm working with WPF, .NET4, EF.

Answers


According to this article: Overview of the editing features in the WPF DataGrid

The datagrid uses IEditableCollectionView<T> (which ObservableCollection<T> implements) - but in order for objects to be editable, you need to make sure that your object T has implemented the IEditableObject Interface. Once you do this, the Datagrid will recognize the collection items as editable and allow you to change them within the grid.


Need Your Help

Help me convert C++ structure into C#

c# c++ pinvoke marshalling dllimport

I am completely new to C#, and need help converting a C++ structure to C#. The C++ structure is given as: