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. Database & SysAdmin
  3. Database
  4. How to sort a column in data grid:

How to sort a column in data grid:

Scheduled Pinned Locked Moved Database
questioncsstutorial
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.
  • K Offline
    K Offline
    kenn_rosie
    wrote on last edited by
    #1

    How to sort a column in data grid: I want to sort on the column "LoanNumber" In my ASP code shown below, I added AllowSorting property to True, in the DataGrid.Which gives me the hyperlink in the header. In order to have this happen I need to do two things: create a sort event handler and specify the event handler for the DataGrid's sort event. I created the sub SortEventHandler as below but I am lost as to what is next to do? Sub SortEventHandler(sender as Object, e as DataGridSortCommandEventArgs) ... End Sub Private Sub DG1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DG1.SelectedIndexChanged End Sub

    S 1 Reply Last reply
    0
    • K kenn_rosie

      How to sort a column in data grid: I want to sort on the column "LoanNumber" In my ASP code shown below, I added AllowSorting property to True, in the DataGrid.Which gives me the hyperlink in the header. In order to have this happen I need to do two things: create a sort event handler and specify the event handler for the DataGrid's sort event. I created the sub SortEventHandler as below but I am lost as to what is next to do? Sub SortEventHandler(sender as Object, e as DataGridSortCommandEventArgs) ... End Sub Private Sub DG1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DG1.SelectedIndexChanged End Sub

      S Offline
      S Offline
      S Douglas
      wrote on last edited by
      #2

      kenn_rosie wrote:

      I created the sub SortEventHandler as below but I am lost as to what is next to do?

      You will probally get an answer in the correct form try the Web Devolopment form[^] Good luck :) BTW, if you wanted to sort the data before presenting it to the user use the Order By [column] in your select statement.


      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