Home All Groups Group Topic Archive Search About

a checkbox in a datagrid

Author
30 Mar 2005 4:35 PM
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

Author
30 Mar 2005 9:00 PM
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
Author
31 Mar 2005 8:05 AM
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)