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 binding issues

DataGrid binding issues

Scheduled Pinned Locked Moved C#
csswpfwinformswcf
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.
  • J Offline
    J Offline
    james cxx
    wrote on last edited by
    #1

    I'm working with the windows forms DataGrid and running into some problems. The DataGrid is bound to a DataView derived from a Dataset, filled by a SqlDataAdapter. I encounter two problems when I call SqlDataAdapter.Fill(dataSet, "Table"): 1) The DataGrid re-sorts based on the first column. 2) If the user had resized any rows, those rows are set back to the default size. Basically, I don't want the appearance of the grid to change when I call Fill(). Is this possible, or do I need to manually manipulate the a dataset. -- James --

    B 1 Reply Last reply
    0
    • J james cxx

      I'm working with the windows forms DataGrid and running into some problems. The DataGrid is bound to a DataView derived from a Dataset, filled by a SqlDataAdapter. I encounter two problems when I call SqlDataAdapter.Fill(dataSet, "Table"): 1) The DataGrid re-sorts based on the first column. 2) If the user had resized any rows, those rows are set back to the default size. Basically, I don't want the appearance of the grid to change when I call Fill(). Is this possible, or do I need to manually manipulate the a dataset. -- James --

      B Offline
      B Offline
      Braulio Dez
      wrote on last edited by
      #2

      Mmmm.... I have the same problem, but I haven't faced it yet :-) ( now I'm still fixing bugs)... some ideas... You can set the sorting column in the DataView( so it's supossed that the DataGrid has nothing to do then). Before calling Fill, you can store in some temporary array or struct ( Memory DataTable with Display/Value columns would be fine :) , or maybe you can save it like a TableStyle )the pair values of Column Name / Column Width, and restore it after calling Fill... to avoid ugly things or flickers, it must be possible to say the DataGrid, Hey ! don't draw now... and when all is done... Now you can refresh, but not sure how. Good luck ! Braulio

      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