Assuming you are using a DataGridView... you will have to create your own
DataGridViewColumn...
Or you can use DataGridViewCheckBoxCell and write code inside the event
CellContentClick
Private Sub DataGridView1_CellContentClick(ByVal sender As System.Object,
ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles
DataGridView1.CellContentClick
Dim lRow As DataGridViewRow
If e.ColumnIndex = 1 Then
lRow = DataGridView1.Rows(e.RowIndex)
If CType(lRow.Cells("Column2").Value, Boolean) = False Then
For Each lRow In DataGridView1.Rows
If lRow.Index <e.RowIndex Then
lRow.Cells("Column2").Value = False
End If
Next
End If
End If
End Sub
In that way you can make sure there is only one checkbox "checked" at the
same time... well... that is the simplest way I can think of...
Daniel.
"Kevin Humphreys" <kh********@hotmail.comwrote in message
news:eb**************@TK2MSFTNGP02.phx.gbl...
Hi,
Is is possible to to add a new column to an Windows app unbound datagrid
where I can place a radiobutton control?
What I am trying to do is to have a radio button for each row on the
datagrid and have one of the radio button to be checked to treat this row
as the primary row ot the recordset.
VB.NET Code preferrably.
Thanks In Advance,
Kevin.