I have
<DataGrid Name="grid" MouseDoubleClick="Attributes_MouseDoubleClick" >
I need to unselect a row whenever a click event occurs anywhere else other than the Datagrid row.
i.e. grid.CurrentItem
should be null
I need to fire a double-click event only on a row.
But, the problem is, once I select a row and double-click elsewhere on the grid(header, empty scrollviewer area, etc) the double-click event fires as expected but the CurrentItem is sometimes the selected row and sometimes null.
To prevent this behaviour.. I need to unselect the selected row.
Any ideas as to how I should approach this?
Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…