Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sorting gridview (using IList instead of Dataset)

Sorting gridview (using IList instead of Dataset)

Scheduled Pinned Locked Moved ASP.NET
algorithmsquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    anada8886
    wrote on last edited by
    #1

    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.

    V A 2 Replies Last reply
    0
    • A anada8886

      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.

      V Offline
      V Offline
      Vipul Mehta
      wrote on last edited by
      #2

      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

      1 Reply Last reply
      0
      • A anada8886

        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.

        A Offline
        A Offline
        Anurag Gandhi
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups