Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Need to put a RadioButton against each Row in a DataGrid view in a Winform Application

I need to put a RadioButton against each Row in a DataGrid view . But Iam unable to find a control like DataGridViewRadioButtonColumn just like DataGridViewTextBoxColumn . So how should I go about doing it ? Thanks in Advance (User can only select one radio button)

like image 961
Ananth Avatar asked Nov 05 '22 06:11

Ananth


1 Answers

You will have to create your own custom Cell and Column to implement this functionality.

There is an excellent article on MSDN that describes this scenario almost exactly. It shows you how to create a custom radio button cell that supports multiple radio buttons per cell. The code could easily be adapted to allow just one radio button per cell.

The article is written for Visual Studio 2005, but should work equally well for VS2008 and VS2010.

like image 150
Jazza Avatar answered Nov 09 '22 13:11

Jazza