DataGrid - Array List - Ordering Columns

D

Doug

Hi,
I am using a datagrid in a windows app and binding it to an ArrayList.
The columns in the array list were appearing out of order so I fixed
that by using the DataGridColumnStyle object in the DataGrid and
setting the MappingName of each column appropriately.

My question though is on properties in the object that is in my
ArrayList that are booleans. Before I created the DataGridColumnStyle
object, the boolean properties showed up as checkboxes. Now, they show
up as a string type with the value written out as "true" or "false".
I'd much rather have the checkboxes. I tried to set the Format value
to System.Boolean or Bool in the DataGridColumnStyle object and neither
worked. Does anyone know what I should be doing?
 
C

Cor Ligthert [MVP]

Doug,

Do you have any reason to use the ArrayList instead of a datatable that fits
perfectly on the datagrid.

The only reason can be in my idea that you want to let it perform slower and
use more memory.

Just my thought,

Cor
 
D

Doug

We're a little restricted by our own standards in regards to using data
table's and or data set's after we get the data back from SQL. We're
required to put the results into business entities. This is a small
set of data though and won't be a huge problem with the issues you
described.

Do you have any suggestions though on the issue I'm trying to resolve?
 
J

julian.holling

You need to make the boolean column a DataGridBoolColumn and add it to
your DataGridTableStyle and this should format it correctly.
 
D

Doug

That did the trick. I didn't even see that column tpe there in the
designer at first. Thanks!
 

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