Just because you name a variable id
the underlying type does not contain a property id
.
You could use an anonymous type as DataSource
:
var ids = new HashSet<String>();
ids.Add("1");
ids.Add("1");
ids.Add("2");
ids.Add("3");
ids.Add("4");
ids.Add("5");
Gridview1.DataSource = ids.Select(id => new { id }).ToList();
Gridview1.DataBind();
However, you are trying to set a boolean property (Enabled
) from an Id
. That seems to be incorrect.
(note that i've changed the name of the HashSet
from id
to ids
since it contains multiples)