I have a GridView which is populated with user information.
System.Web.Security.MembershipUserCollection users = System.Web.Security.Membership.GetAllUsers();
grid.DataSource = users;
this.DataBind();
In the RowDataBound event, it looks up additional user information and populates columns with this info.
Due to the nature for the GetAllUsers() function, the grid is sorted by username. I would like for it to sort by FullName, one of the columns that is looked up and populated in the RowDataBound even code. How can I do this? Everything I see on sorting for a GridView has you sort the datasource before applying it to the grid, but in this case I do not have that data yet.
You can sort gridview’s datasource before data-binding: