adding radiobutton or checkbox in a datagrid

D

daisy

I have a windows form application. In which I have a
datagrid bound to a dataset.

Can I have a checkbox or a radiobutton as a column in the
datagrid I am using Visual studio.net, with .net framework
1.0.

This is possible in asp.net aplication but don't know how
to do it using windows form datagrid. Also I don't want to
add any 3rd party control.

Thanks
 
O

o'g

to add a checkbox to a grid the datatype of the
datasource's column that you want to be displayed must be
boolean... not sure about a radiobutton in a datagrid...

try this code out for a checkbox though..

Dim dt As New DataTable
Dim dr As DataRow

dt.Columns.Add("TRUEFALSE")
dt.Columns("TRUEFALSE").DataType = GetType
(System.Boolean)

dr = dt.NewRow
dr(0) = False
dt.Rows.Add(dr)

dr = dt.NewRow
dr(0) = True
dt.Rows.Add(dr)


Me.DataGrid1.DataSource = dt
 

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