/// <summary> /// Returns the selected ListItem's values from the ListItemCollection. This /// will attempt to convert the values to a generic type /// </summary> public static IEnumerable <T> SelectedValues <T>(this ListItemCollection value) { var values = value.SelectedValues(); if (values.Count() == 0) { return(new Collection <T>()); } return(values.Select(x => (T)Convert.ChangeType(x, typeof(T)))); }