Sorting gridview (using IList instead of Dataset)
-
Hello everyone, Basically my task is sorting the gridview manually and I got many solutions for that. But all of them are having the following thing in common.
DataView dv = new DataView(dt);
dv.Sort = sortExpression + direction;But in my code, I have to bind an IList (collection or generics), and not any dataset, to my gridview. Somehow,I am not able to find the Sort property for an IList. Could anyone please suggest what can I do about this?Do I have to convert the IList to a daraset?if yes,please tell how? Thank You.
-
Hello everyone, Basically my task is sorting the gridview manually and I got many solutions for that. But all of them are having the following thing in common.
DataView dv = new DataView(dt);
dv.Sort = sortExpression + direction;But in my code, I have to bind an IList (collection or generics), and not any dataset, to my gridview. Somehow,I am not able to find the Sort property for an IList. Could anyone please suggest what can I do about this?Do I have to convert the IList to a daraset?if yes,please tell how? Thank You.
Hi, I guess the below link might be helpful in your scenario.. http://geekswithblogs.net/paulwhitblog/archive/2006/05/08/77581.aspx[^]
Regards, Vipul Mehta
-
Hello everyone, Basically my task is sorting the gridview manually and I got many solutions for that. But all of them are having the following thing in common.
DataView dv = new DataView(dt);
dv.Sort = sortExpression + direction;But in my code, I have to bind an IList (collection or generics), and not any dataset, to my gridview. Somehow,I am not able to find the Sort property for an IList. Could anyone please suggest what can I do about this?Do I have to convert the IList to a daraset?if yes,please tell how? Thank You.
You can use Linq to sort your Collection. http://www.onedotnetway.com/dynamic-sort-with-linq/[^] The above link will guide you to sort your collection dynamically using Linq.
Anurag Gandhi. http://www.gandhisoft.com Life is a computer program and every one is the programmer of his own life.