DataGridBoolColumn and Arraylist don't work right

G

Guest

Hi,
I have a datagrid, datasource is an Arraylist. I've been able to add the
columns I want; a few string columns and a few DataGridBoolColumns. The
ArrayList is being populated before the form is opened, and all the data
appears on it as I would expect, except for the DataGridBoolcolumns. These
appear grayed and checked, regardless of the value (some are actually true,
some are actually false, none are null).
I've set the columnstyle options allownull=false, truevalue="1" (also tried
"true", 1, etc), falsevalue="0" (also tried "false", 0, etc). Nothing seems
to help. When the truevalue is set = "1", I'm able to check and uncheck
these. When it's set to something else, when I check/uncheck, I get a
casting exception. So, leaving it at ="1" seems to work, but when I click
out, the change vanishes and the checkbox goes back to grayed out.
The textbox type columns are changable... I can change the text, exit out,
and the changes remain in place.
The data type on the elements in the class that the arraylist is based on
are boolean for those DataGridBoolColumns. The source data is not in a
database, so I can't use any time of table binding.
Any thoughts?
Thanks
 
G

Guest

Note that I got rid of the exceptions using 1 and 0.
However, this made me think maybe the set property method in the class
needed tweaking.
SO..... I re-examined the class that the arraylist is made up of...
discovered that the
property in question was set up as String... so I changed it to boolean,
then made sure that the truevalue= True, and falsevalue= False, started it up
again, and it works!
 

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

Top