Requirement: create a GridView using LINQ and List;
Code:
Set DataSource:
GridViewUsers.DataSource = userManager.GetDataSource();
GridViewUsers.DataBind();
UserManager:
private List<User> users = new List<User>();
public List<User> GetDataSource() {
var query =
from user in users
select user;
return query.ToList();
}
// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.