I am trying to determine which row (RowDefinition) my mouse is over within a WPF grid.
I have tried adding the MouseEnter event to the RowDefinition but the event doesn’t fire, the Event does fire on the Grid itself but that doesn’t help as I need the name of the row the mouse is currently over.
Thanks in advance.
Have your handler on each element, not on the grid itself. E.g. if you have
TextBlocksthere you can set handler using style:Then within handler you know the element from
MouseEventArgs.Source. DoGetValue(Grid.RowProperty)if you need to find out row number and if you really needRowDefinition, get it fromGrid.RowDefinitions: