I have a DataGrid
which has plenty rows and columns,
I want to get the cell ready for editing when the user focus the mouse on it (IsMouseOver
).
So far, all I found is this
<Window.Resources>
<Style TargetType="{x:Type DataGridCell}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="green"></Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
I am able to set a property for the cell when the mouse is over it. But how to launch an event when the mouse is over?
I would add an EventSetter in a Style like this :
Here is the handler:
In fact you said you want to edit something. In my case, there is a TextBox and i reach it with this helper:
After reaching it, a simple Focus() will do the final job.