Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make it possible to ONLY select one row in datagrid?

I want my datagrid to only allow one row to selected.

I guess I can do this by adding code to the datagridviews selectionChanged-event, but is there a better solution?

I would prefer to just have a property to set, i.e. : mydatagridview.maximumNrOfRowsSelected = 1; or something similar.
Is there anything like this?

like image 559
Sebastian Larsson Avatar asked Dec 26 '09 11:12

Sebastian Larsson


1 Answers

The DataGridView has a Property called MultiSelect ( default True ).

Set this to False.

like image 194
Adriaan Stander Avatar answered Sep 20 '22 20:09

Adriaan Stander