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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Sorting the Datagrid on Date Time

Sorting the Datagrid on Date Time

Scheduled Pinned Locked Moved ASP.NET
helpdatabasealgorithmsquestion
3 Posts 2 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.
  • S Offline
    S Offline
    Shreeja
    wrote on last edited by
    #1

    Hi, all Can any one please help me out to Sort Datetime Column in a Datagrid (asc or desc)? I am finding problem in the Sort property of Dataview which does not sort the Datetime column in the datagrid properly (Ascending or descending) . I want to avoid using "order by" option in the sql statement . Thanks in Advance Shreeja. ShreejaRajan

    A 1 Reply Last reply
    0
    • S Shreeja

      Hi, all Can any one please help me out to Sort Datetime Column in a Datagrid (asc or desc)? I am finding problem in the Sort property of Dataview which does not sort the Datetime column in the datagrid properly (Ascending or descending) . I want to avoid using "order by" option in the sql statement . Thanks in Advance Shreeja. ShreejaRajan

      A Offline
      A Offline
      atul_moghe
      wrote on last edited by
      #2

      hi there, No need to put any extra effort, datatime field also get sorted by the sort expression. There may have some other problem b'coz in my many pages it sorted well. Dim sortField As String = e.SortExpression dv.Sort = sortField dgDisplay.DataSource = dv dgDisplay.DataBind() A R MOGHE.

      S 1 Reply Last reply
      0
      • A atul_moghe

        hi there, No need to put any extra effort, datatime field also get sorted by the sort expression. There may have some other problem b'coz in my many pages it sorted well. Dim sortField As String = e.SortExpression dv.Sort = sortField dgDisplay.DataSource = dv dgDisplay.DataBind() A R MOGHE.

        S Offline
        S Offline
        Shreeja
        wrote on last edited by
        #3

        Hi Mr.MOGHE, Thank you for your reply. But this seems like not working for me . The grid column does not get sorted properly on time when you specify AM and PM along with date and time. ShreejaRajan

        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