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. DataGridView updating datasource problem

DataGridView updating datasource problem

Scheduled Pinned Locked Moved C#
6 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.
  • H Offline
    H Offline
    half life
    wrote on last edited by
    #1

    hi, the layout: 1. datagridview with a datasource (access db) 2. new button column "Update" to ... the problem: whenever i click on the Update Button, without pressing Enter when i've finished editing no updtae occures (to the db file) in other words :) :) :) only when i press the Enter after i've finished editing a cell and then press the "Update" button the update occures (to the db file) the Q??? what the hell????, Sorry sorry what is hapening, i've added the valuechanged event (on the data grid view) and the value did change before i click the Update Button, is there any push value to... help :sigh:

    Have Fun Never forget it

    G 1 Reply Last reply
    0
    • H half life

      hi, the layout: 1. datagridview with a datasource (access db) 2. new button column "Update" to ... the problem: whenever i click on the Update Button, without pressing Enter when i've finished editing no updtae occures (to the db file) in other words :) :) :) only when i press the Enter after i've finished editing a cell and then press the "Update" button the update occures (to the db file) the Q??? what the hell????, Sorry sorry what is hapening, i've added the valuechanged event (on the data grid view) and the value did change before i click the Update Button, is there any push value to... help :sigh:

      Have Fun Never forget it

      G Offline
      G Offline
      Greg Chelstowski
      wrote on last edited by
      #2

      The CellValueChanged event triggers, I believe, after the cell you've been editing comes out of editmode. I would say, on the buttonclick of your updatebutton use your CurrentCell's EditedFormattedValue in your db updating method. Hope this makes sense...

      var question = (_2b || !(_2b));

      H 1 Reply Last reply
      0
      • G Greg Chelstowski

        The CellValueChanged event triggers, I believe, after the cell you've been editing comes out of editmode. I would say, on the buttonclick of your updatebutton use your CurrentCell's EditedFormattedValue in your db updating method. Hope this makes sense...

        var question = (_2b || !(_2b));

        H Offline
        H Offline
        half life
        wrote on last edited by
        #3

        first of all thanks for replying :) CurrentCell's EditedFormattedValue is not helping because i'm updating using the tableAdaptor.Update(Row) method :) and the thing is that Pressing the Enter button or not does;nt change the fact that the value has changed :) :) but still - if i'll not press the Enter button the updating will not occur :) thanks

        Have Fun Never forget it

        H 1 Reply Last reply
        0
        • H half life

          first of all thanks for replying :) CurrentCell's EditedFormattedValue is not helping because i'm updating using the tableAdaptor.Update(Row) method :) and the thing is that Pressing the Enter button or not does;nt change the fact that the value has changed :) :) but still - if i'll not press the Enter button the updating will not occur :) thanks

          Have Fun Never forget it

          H Offline
          H Offline
          Henry Minute
          wrote on last edited by
          #4

          half-life wrote:

          and the thing is that Pressing the Enter button or not does;nt change the fact that the value has changed

          It has changed on the screen, but has it changed in the bindinglist? But why should anyone answer your question? You obviously know all the answers already!

          Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

          H 1 Reply Last reply
          0
          • H Henry Minute

            half-life wrote:

            and the thing is that Pressing the Enter button or not does;nt change the fact that the value has changed

            It has changed on the screen, but has it changed in the bindinglist? But why should anyone answer your question? You obviously know all the answers already!

            Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

            H Offline
            H Offline
            half life
            wrote on last edited by
            #5

            now i know u're meaning in life is to pursue not happiness but People insted :) :) nice :) go for it, and to your Q yes it has changed in the bindinglist :) i've fixed that too oow, again thanks for your help :) :) but please don't help me in the future

            Have Fun Never forget it

            H 1 Reply Last reply
            0
            • H half life

              now i know u're meaning in life is to pursue not happiness but People insted :) :) nice :) go for it, and to your Q yes it has changed in the bindinglist :) i've fixed that too oow, again thanks for your help :) :) but please don't help me in the future

              Have Fun Never forget it

              H Offline
              H Offline
              Henry Minute
              wrote on last edited by
              #6

              Oh really, it's no problem!

              Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

              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