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. General Programming
  3. C#
  4. DATA GRID sorting problem.

DATA GRID sorting problem.

Scheduled Pinned Locked Moved C#
cssalgorithmshelptutorialquestion
4 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.
  • K Offline
    K Offline
    kumar bs
    wrote on last edited by
    #1

    My requirement is, i added 50 empty rows to the Data grid. One of the columns of the datagrid is of ComboBoxColumnStyle. Now after filling data into just two rows (remember i have 50 empty rows), when i click on column header of ComboBoxColumnStyle columns it is sorting the total 50 rows, but i want to ignore the empty rows (other 48 rows). Because if i don't ignore the empty rows and sort the rows with data are being moved to end of the grid, leaving all above rows empty. Any ideas, how to sort rows only with data? Thanks kumar

    M M 2 Replies Last reply
    0
    • K kumar bs

      My requirement is, i added 50 empty rows to the Data grid. One of the columns of the datagrid is of ComboBoxColumnStyle. Now after filling data into just two rows (remember i have 50 empty rows), when i click on column header of ComboBoxColumnStyle columns it is sorting the total 50 rows, but i want to ignore the empty rows (other 48 rows). Because if i don't ignore the empty rows and sort the rows with data are being moved to end of the grid, leaving all above rows empty. Any ideas, how to sort rows only with data? Thanks kumar

      M Offline
      M Offline
      Manoj Kumar Rai
      wrote on last edited by
      #2

      Hi, You can set the "SortMode" properties for the column as "Programatic". In this case you can control the time when you want the sorting to take place.

      Manoj Never Gives up

      1 Reply Last reply
      0
      • K kumar bs

        My requirement is, i added 50 empty rows to the Data grid. One of the columns of the datagrid is of ComboBoxColumnStyle. Now after filling data into just two rows (remember i have 50 empty rows), when i click on column header of ComboBoxColumnStyle columns it is sorting the total 50 rows, but i want to ignore the empty rows (other 48 rows). Because if i don't ignore the empty rows and sort the rows with data are being moved to end of the grid, leaving all above rows empty. Any ideas, how to sort rows only with data? Thanks kumar

        M Offline
        M Offline
        Meenakshi Sundaram k
        wrote on last edited by
        #3

        its simple write one for loop for geeting all the data from datagrid and check within for loop the data is available or not .if the data is available sort the data.

        K 1 Reply Last reply
        0
        • M Meenakshi Sundaram k

          its simple write one for loop for geeting all the data from datagrid and check within for loop the data is available or not .if the data is available sort the data.

          K Offline
          K Offline
          kumar bs
          wrote on last edited by
          #4

          In which event should i write this code?

          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