"
Complex DataBinding accepts as a data source either an IList or an IListSource" error message means that you have to bind list of object (complex data type) rather than
IEnumerable<String>
.
Try to change code as follow:
DataTable dt = new DataTable();
dt.Columns.Add("Date",typeof(DateTime));
dt.Columns.Add("Name",typeof(string));
dt.Columns.Add("City",typeof(string));
dt.Columns.Add("Mobile",typeof(string));
dt.Rows.Add(new object[]{new DateTime(2014,11,1), "David", "Noida", "Bsnl"});
dt.Rows.Add(new object[]{new DateTime(2014,11,1), "James", "Mumbai", "Airtel"});
dt.Rows.Add(new object[]{new DateTime(2015,1,30), "Ramesh", "Pune", "Vodafone"});
dt.Rows.Add(new object[]{new DateTime(2015,1,30), "Kamal", "Kolkata", "Idea"});
dt.Rows.Add(new object[]{new DateTime(2015,5,15), "Mahesh", "Chennai", "Reliance"});
var days = dt.AsEnumerable().Select(a=>a.Field<datetime>("Date")).Distinct().ToList();
dataGrid1.DataSource = days;</datetime>
days
object is type of
List<DateTime>
. It should resolve your issue ;)