Hello,
I am having an issue trying to add a checkbox field to my DataGrid. I have the following Code but it does not display my checkbox. Any help is greatly appreciated.

Dim myconnection1 As New SqlConnection(myconn)
        Dim dtcCheck As New DataColumn("Select")
        dtcCheck.DataType = System.Type.GetType("System.Boolean")
        dtcCheck.DefaultValue = False
        Dim sa As New SqlDataAdapter("SELECT * FROM therapy", myconnection1)
        sa.Fill(ds, "Therapy")
        DataGridView1.DataSource = ds.Tables("Therapy")
        ds.Tables.Add.Columns.Add(dtcCheck)

Thank You

I used this code to create a table with each month as a checkbox

Dim chkBox As System.Type = System.Type.GetType("System.Boolean")
        With dtYear.Columns
            .Add("Jan", chkBox)
            .Add("Feb", chkBox)
            .Add("Mar", chkBox)
            .Add("Apr", chkBox)
            .Add("May", chkBox)
            .Add("Jun", chkBox)
            .Add("Jul", chkBox)
            .Add("Aug", chkBox)
            .Add("Sep", chkBox)
            .Add("Oct", chkBox)
            .Add("Nov", chkBox)
            .Add("Dec", chkBox)
        End With

Try using this syntax

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.