a checkbox in a datagrid

S

Sam

Hi,
I have a datagrid which the first two columns are set from a dataset
linked to a database. I would like to add manually a third column in
which there would be a checkbox (one per row). This checkbox doesn't
have to be linked to any dataset.
I've seen methods in faqs but I find them a bit of a harssle. I'm sure
there must be a simple way to do that. Does anybody know ?

Thx
 
C

Cor Ligthert

Sam,

A dataset holds not any column at all. It holds tables.
A datagrid holds not any column at all, it shows the columns of tables
(eventually in a dataset).

Therefore you can add too the datatable that has the two other columns a
datatable a column (type system.bool) and your question should be solved.

I hope this helps,

Cor
 
S

Sam

Thanks it worked :)
If someone is interested :

da.Fill(dsFields)
Dim col As New DataColumn
With col
.ColumnName = "selected"
.DataType = Type.GetType("System.Boolean")
End With
dsFields.Tables(0).Columns.Add(col)
 

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