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

后端 未结 3 1168
余生分开走
余生分开走 2021-01-18 19:43

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

3条回答
  •  情话喂你
    2021-01-18 20:23

    though I am not fully understand your requirement, do you think using an ObservableCollection will solve your issue?

    public abstract class TestElementList : ObservableCollection
        where T : class
     {
       public virtual T Get(int index)
       {
         T item = this[index];
         return item;
       }
    
       public virtual void Set(int index, T item)
       {
         this[index] = item;
       }
     ...
    }
    

提交回复
热议问题