Hi there!
Im using Linq...more specifically, PLINQO. anyway the following is an example of a query I have bound to a datagridview (winforms):
public static List<Task> GetUserTasks( Guid userID ) {
using (myDataContext ctx = new myDataContext()) {
try {
return ctx.Manager.Task.GetByUserID( userID ).ToList();
} catch (Exception) {
throw;
}
}
}
In my UI, I have the following setup to bind:
BindingSource bs = new BindingSource();
bs.DataSource = DUtasks.GetUserTasks( User.Current.UserID );
dgvTasks.DataSource = bs;
It works, but no sorting is possible. I tried "AsEnumerable()" instead of "ToList()" but that for some reason, throws an "objection reference" error. Any ideas as to how I can proceed on this front?
Many thanks!