Error: Cannot implicitly convert type ‘void’ to ‘System.Collections.Generic.List’

You can’t do that because the Add function returns void, not a reference to the list. You can do this:

mycontrol.ItemList = new List<Item>();
mycontrol.ItemList.Add(item);

or use a collection initializer:

mycontrol.ItemList = new List<Item> { item };

Leave a Comment