views:

185

answers:

2

Hey guys,

As the title says - I want my datagrid to only allow one single row as selected at the same time.

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 similiar. Is there anything like this? THX!

Sebastian

+2  A: 

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

Set this to False.

astander
A: 

Yes, I actually found the answer myself about the same time as you posted your answer. Thx a bunch anyways!

Sebastian

Sebastian Larsson
You should now mark astanders answer as "correct"
Nifle