Unplanned
Last Updated: 04 Aug 2020 18:18 by ADMIN
Paul
Created on: 03 Aug 2020 23:24
Category: MultiSelect
Type: Feature Request
4
Change TelerikMultiSelect.Value to Type ICollection<T> or IList<T>

I have a custom ICollection which I wanted to use with the MultiSelect control, however, the Value property is of type List<T>. This is very restrictive; the property should implement an interface for flexibility.

ADMIN EDIT: When voting, please add your comment on what you would prefer so we can gauge the needs people have and act accordingly.

3 comments
ADMIN
Marin Bratanov
Posted on: 04 Aug 2020 18:18

Hi Paul,

I have updated the title to include the IList<T> idea so we can see whether that will appeal to more people.

 

Regards,
Marin Bratanov
Progress Telerik

Paul
Posted on: 04 Aug 2020 18:05

Hi Marin,

I believe IList<T> would suffice without any breaking changes as List<T> directly implements that interface.

Unfortunately, I cannot convert to List as its a custom implementation of ICollection<T> to do additional logic for the Add/Remove methods. I could however, change my custom collection to inherit from IList<T> as it also inherits ICollection<T> and would be a simple change.

ADMIN
Marin Bratanov
Posted on: 04 Aug 2020 14:48

Hi Paul,

What I can suggest is that you add a field in the view-model that's a List<T>, and use its getter and setter to convert it from the ICollection<T>.

That said, I am not sure if moving to an ICollection is a viable option for the component, because the List allows for more features - like sorting, random access and modified, while also such a change might be perceived as a breaking change by our existing customers.

Nevertheless, I am keeping this item open in the portal so we can gauge the community interest in such a change and its popularity. If it gets enough traction, it will be considered for implementation.

 

Regards,
Marin Bratanov
Progress Telerik