Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

WPF DataGrid CheckBox Check/Uncheck with single click

$
0
0

Hi,

I need check and uncheck of CheckBox using spacebar key in a single click.I tried like below.

<my:DataGridTemplateColumn Header="Chk" MinWidth="40">     

<my:DataGridTemplateColumn.CellTemplate>                           

<DataTemplate>                               

<CheckBox IsChecked="{Binding Path=SELECT,UpdateSourceTrigger=PropertyChanged}" Name="ChkSelect"

Click="ChkSelect_Click" KeyDown="ChkSelect_KeyDown"/>                           

</DataTemplate>                       

</my:DataGridTemplateColumn.CellTemplate>                   

</my:DataGridTemplateColumn>

With mouse I am able to check/uncheck in a single click.But the same thing I am not able to do it with spacebar key.The key down event is firing only when I press tab key twice.How to achieve check/uncheck CheckBox in a single click using spacebar key?

 

cas


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>