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. DataGrid sort problem

DataGrid sort problem

Scheduled Pinned Locked Moved C#
helpquestion
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.
  • C Offline
    C Offline
    choopie
    wrote on last edited by
    #1

    Hello, here is my problem. I have a DataGrid control with some columns. My question is about two of them. When I enter a value in any cell of the first column I want to calaculate (by expression) the value of the second column by using the value of the first column in the same row. OK, I have a function which does that and works fine, but when I click to sort the DataGrid it doesn't work correct. I use DataView to navigate through the records in a DataTable. All of the columns are in this DataTable. Where do I make a mistake? Can somebody help?

    F 1 Reply Last reply
    0
    • C choopie

      Hello, here is my problem. I have a DataGrid control with some columns. My question is about two of them. When I enter a value in any cell of the first column I want to calaculate (by expression) the value of the second column by using the value of the first column in the same row. OK, I have a function which does that and works fine, but when I click to sort the DataGrid it doesn't work correct. I use DataView to navigate through the records in a DataTable. All of the columns are in this DataTable. Where do I make a mistake? Can somebody help?

      F Offline
      F Offline
      faladrim
      wrote on last edited by
      #2

      what did u use to sort the table, i use this: xDataSet.xtable.DefaultView.RowFilter= " xcolumnname LIKE '%" + txt_zoeken.Text+ "%' "; dataGridView1.DataSource = xDataSet.xtable.DefaultView; but i dont know how to sort the whole table in ones, i only sort in one column. let me know i u find how to do this thx grz

      C 1 Reply Last reply
      0
      • F faladrim

        what did u use to sort the table, i use this: xDataSet.xtable.DefaultView.RowFilter= " xcolumnname LIKE '%" + txt_zoeken.Text+ "%' "; dataGridView1.DataSource = xDataSet.xtable.DefaultView; but i dont know how to sort the whole table in ones, i only sort in one column. let me know i u find how to do this thx grz

        C Offline
        C Offline
        choopie
        wrote on last edited by
        #3

        We talk about different things. I don't know how u may sort your table at once. Post your problem. I'm sure someone could help you.

        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