Click here to Skip to main content
15,880,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

How to insert radiobutton in datagridview using (Windows forms)?

Its Urgent.
Posted
Updated 2-Nov-10 20:02pm
v3

Check MSDN here[^].
 
Share this answer
 
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

regards,
Saran.t
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900