I am trying to get the CollectionEditor working for ObservableCollection<int>.
I am not able to add items. If I create a object with one int property I can add to the collection.
Is there a way to get it working with a list of int's?
3 Answers, 1 is accepted
0
Maya
Telerik team
answered on 31 May 2013, 01:43 PM
Hi Martin,
The ability to insert an new item depends on:
1. Whether the source collection supports such functionality - to add/ insert a new element - this is supported by ObservableCollection
2. Business object should have default parameterless consturctor - which int element does not.
So, if you want to insert new items, you need to make sure that both conditions are satisfied.
You can new a int like this: var x = new int();
But is it because int is a value type?
0
Maya
Telerik team
answered on 03 Jun 2013, 10:27 AM
Hi Martin,
The ability of the collection editor to insert new item corresponds to the property of the IEditableCollectionView - CanAddNew. Please check out this article for more information.