views:

83

answers:

1

I have a DataGrid with first column as text column and second column as CheckBox column. What I want is, if I click the check box. It should get checked.

But, it takes two click to get selected, for first click the cell is getting selected, for the second clicks the check box is getting checked. How to make the check box to get checked/unchecked with a single click.

Note:I'm using WPF 4.0

Edit: Columns in the DataGrid are AutoGenerated.

+3  A: 

This is for 3.5sp1, I know - but it should work under 4.0: Vinsibal.

Goblin
@Goblin, In my grid. The columns are AutoGenerated. How to tag the DataGridCell_PreviewLeftButtonDown on auto generated column. Any Idea?
Avatar
You have to hook into the AutoGeneratingColumn and AutoGeneratedColumns events - see here for details: http://blogs.msdn.com/b/vinsibal/archive/2008/08/26/wpf-datagrid-working-with-datagridcomboboxcolumn.aspx
Goblin
Super Great!! Thanks :)
Avatar
No probs :) Vincent Sibal is your friend for anything DataGrid-related (well, anything in the toolkit really)
Goblin