data on datagridview not updated

  • Thread starter Thread starter Danny Nielsen
  • Start date Start date
D

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
 
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
 
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top