Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
108
XamGrid: IsMouseOver resets to false on cell click
posted

Hello,

I'm having a difficulty implementing custom row hover behaviour. The general idea is to disable hover effects for specific rows (based on data bound to row). So, I restyled the CellControl and used triggers instead of VisualStateManager states to provide effects.

However, one thing is working strangely. The IsMouseOver property is set to false as long as I hold the mouse button. This makes the row de-highlighted and causes a very nasty graphical glitch.

WPF Inspector says that all controls nested within XamGrid lose the IsMouseOver property, except the XamGrid itself. It, however, has its IsMouseCaptured property set to True.

Is it possible to somehow disable this odd logic and have the IsMouseOver property value maintained?

Parents
No Data
Reply
  • 138253
    Offline posted

    Hello,

     

    Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I copied the default Style for the CellControl and removed a State that changes the Background of the Cell and added a MultiDataTrigger bound to the Row’s IsMouseOver Property and to the underlying object’s Property. Please let me know if you need further clarifications on this matter.

     

    Looking forward for your reply.

    XamGridMouseOver.zip
Children