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. DataView.Sort int

DataView.Sort int

Scheduled Pinned Locked Moved ASP.NET
helptutorialquestion
2 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.
  • G Offline
    G Offline
    gadgetfbi
    wrote on last edited by
    #1

    If I have a dataSet and wish to sort it either ASC or DESC by a col - easly done using a dataview. Now if that col contains int's, say 1 - 13 this is where my problem starts. I have noticed this in windows too. create 13 files named 1 - 13 it will sort them in the order 1,10,11,12,13,2,3,4,..... the same seems to be happening to my dataView. Any suggestions as to how to work around this? Tia gadget

    M 1 Reply Last reply
    0
    • G gadgetfbi

      If I have a dataSet and wish to sort it either ASC or DESC by a col - easly done using a dataview. Now if that col contains int's, say 1 - 13 this is where my problem starts. I have noticed this in windows too. create 13 files named 1 - 13 it will sort them in the order 1,10,11,12,13,2,3,4,..... the same seems to be happening to my dataView. Any suggestions as to how to work around this? Tia gadget

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      When windows do that for file name,thats because the file names are string and it sort them as string values,so thats correct sorting. DataGrid and DataSet automaticlly detect type of your coluumn and sort them corectlly.Maybe you set 1-13 value as string and it sort them like that,you have to set type of column as integer to get coorect results. Mazy No sig. available now.

      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