data on datagridview not updated

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny Nielsen

    #1

    data on datagridview not updated

    Hi

    I am new to vb.net 2005 (in fact vb in general as well). I have tried
    creating a datagridview with 4 columns, with one as a
    DataGridViewChe ckBoxColumn. My problem are that data has been put in
    the way they should from my db but updates arent visible on this
    particular column. The data are either 1 or 2 and I have put in these
    values on the DataGridViewChe ckBoxColumn so it should show true/false
    depending on these values. When I try to update the column by moving on
    to the next row I am able to, but this particular column turns back to
    its original value.

    I am missing something, arent I ? - tx for your answers

    Danny

  • Cor Ligthert [MVP]

    #2
    Re: data on datagridview not updated

    Danny,
    [color=blue]
    >The data are either 1 or 2 and I have put in these
    > values on the DataGridViewChe ckBoxColumn so it should show true/false
    > depending on these values.[/color]

    Why, the datagridviewche ckboxcolumn has as underlaying dataelement a boolean
    value.
    It can be true or false never 1 or 2.

    To solve that see this sample. Be aware that if you are updating this than
    you have to do special actions before by instance looping through your
    datatable. Therefore using the boolean in your database will be probably
    better.

    This sample goes in the opposite direction, it makes from a boolean a name,
    so you have to change it t a little bit.



    I hope that this gives an idea.

    Cor


    Comment

    • Danny Nielsen

      #3
      Re: data on datagridview not updated

      tx Cor - that seemed to do the trick.

      Comment

      • Danny Nielsen

        #4
        Re: data on datagridview not updated

        Thanks Cor .. that seemed to do the trick

        Comment

        • Homer J Simpson

          #5
          Re: data on datagridview not updated


          "Cor Ligthert [MVP]" <notmyfirstname @planet.nl> wrote in message
          news:OATPuIaHGH A.312@TK2MSFTNG P09.phx.gbl...
          [color=blue]
          > Why, the datagridviewche ckboxcolumn has as underlaying dataelement a
          > boolean value. It can be true or false never 1 or 2.[/color]

          I believe you can set what values are associated with true, false, and
          tristated.



          Comment

          Working...