Reputation: 13308
I'm working with WPF dataGrind now and faced with an ussie. I need that dataGrid always has one selected row. Always and only one.
Is it possible?
Upvotes: 0
Views: 1173
Reputation: 22445
try this:
<DataGrid SelectionMode="Single" SelectionUnit="FullRow" PreviewMouseDown="PreviewMouseDown"/>
edit:
private void PreviewMouseDown(object sender, MouseButtonEventArgs e)
{
if (Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl))
e.Handled = true;
}
Upvotes: 2