Home All Groups Group Topic Archive Search About

data on datagridview not updated

Author
20 Jan 2006 8:35 AM
Danny Nielsen
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
DataGridViewCheckBoxColumn. 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 DataGridViewCheckBoxColumn 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

Author
20 Jan 2006 9:17 AM
Cor Ligthert [MVP]
Danny,

>The data are either 1 or 2 and I have put in these
> values on the DataGridViewCheckBoxColumn so it should show true/false
> depending on these values.

Why, the datagridviewcheckboxcolumn 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.

http://www.vb-tips.com/default.aspx?ID=76a81eb8-ea2d-48f4-99c3-a3539697edbd

I hope that this gives an idea.

Cor
Author
23 Jan 2006 11:18 AM
Danny Nielsen
tx Cor - that seemed to do the trick.
Author
23 Jan 2006 11:19 AM
Danny Nielsen
Thanks Cor .. that seemed to do the trick
Author
11 Feb 2006 9:52 PM
Homer J Simpson
"Cor Ligthert [MVP]" <notmyfirstn***@planet.nl> wrote in message
news:OATPuIaHGHA.312@TK2MSFTNGP09.phx.gbl...

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

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