DataGrid edition 'EditItem' is not allowed for this view` when bound to a WPF DataGrid

后端 未结 8 1554
醉酒成梦
醉酒成梦 2020-12-09 17:03

I\'ve been reading about this at least for 4 hours, and seems to be the list type, but I have a situation:

A ObservableCollection that has a collection property.

8条回答
  •  自闭症患者
    2020-12-09 17:23

    I tried this and the problem is that you have initialized your Level2 collection as Hashset<>. IEditableCollectionView.EditItem() throws this error while trying to update item in Hashset<>. I initialized the collection as List<> and it was working fine.

    I am not sure why it is not able to update item in hashset, need to look deeper into it. But changing the Hashset<> to List<> will fix this error.

    Hope it helps

    Thanks

提交回复
热议问题