Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF XAML : How to disable multi selection in a DataGrid?

In a DataGrid like this :

<DataGrid  AutoGenerateColumns="False" Height="200" Name="dataGrid"     IsReadOnly="True" ItemsSource="{Binding CollectionView}" > ... </Datagrid> 

How do you disable the multi selection feature ?

(I'm sure it's simple, but I don't find it.)

like image 734
Philippe Lavoie Avatar asked Feb 03 '11 19:02

Philippe Lavoie


1 Answers

Set the DataGrid.SelectionMode:

<DataGrid SelectionMode="Single" ... 
like image 64
Reed Copsey Avatar answered Sep 28 '22 04:09

Reed Copsey