'EditItem' is not allowed for this view - databinding issue

Posted by Pawan on Stack Overflow See other posts from Stack Overflow or by Pawan
Published on 2010-06-08T23:22:56Z Indexed on 2010/06/08 23:32 UTC
Read the original article Hit count: 2527

Hi, I am trying to do data binding in WPF on data grid using a cutom list. My custom list class contains a private data list of type List. I can not expose this list however the indexers are exposed for seeting and getting individual items. My custom class looks like this:

public abstract class TestElementList<T> : IEnumerable
        where T : class
{
    protected List<T> Data { get; set; }
    public virtual T Get(int index)
    {
        T item = Data[index];
        return item;
    }

    public virtual void Set(int index, T item)
    {
         Data[index] = item;
    }
...
}

The data is binded but when I try to edit it, i get "'EditItem' is not allowed for this view." Error. On doing extensive searching over web, I found that i might need to implement IEditableCollectionView interface also. Can anybody please help me to either give pointers on how to implement this interface or any suggest any other better way to do databinding on custom list.

Thanks in advance.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about databinding