I want to convert the items entered to a String list to:
System.Collections.ObjectModel.ReadOnlyCollection<string>
I have tried using:
(System.Collections.ObjectModel.ReadOnlyCollection<string>)listname
But it returns an error.
You can create a new instance using the existing List in the constructor.
var readOnlyList = new ReadOnlyCollection<string>(existingList);
ReadOnlyCollection(Of T) Constructor on MSDN
1.4m articles
1.4m replys
5 comments
56.9k users