RadListView ItemMouseHover is not firing?

1 Answer 95 Views
ListView
Willy
Top achievements
Rank 2
Iron
Iron
Willy asked on 08 Mar 2022, 07:31 PM

Hello,

I am knee deep converting our business app over to Telerik (which is an awesome suite of tools I wish I would have gotten it sooner!) and am running into an issue with the RadListView in detail view. I really need the ItemMouseHover event to work so I can show a custom form while the mouse is over the item but for some reason it's not firing. I have tested the ItemMouseEnter and ItemMouseLeave events and they fire correctly. Is there something I am missing to enable this event?

My test code is really simple:

  Private Sub lvBusinessApps_ItemMouseHover(sender As Object, e As ListViewItemEventArgs) Handles lvBusinessApps.ItemMouseHover
        Debug.Print("Hover")
  End Sub

 

Thank you

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 11 Mar 2022, 12:21 PM
Hello, Bill,

When RadListView is used in DetailsView, it uses cell elements, not visual item elements. That is why the ItemMouseHover wouldn't be fired. The possible solution that I can suggest is to subscribe to the RadListView.MouseHover event and detect what is the element under the mouse. If it is a cell element, perform the desired action, for example, show a form: 
        AddHandler Me.RadListView1.MouseHover, AddressOf RadListView1_MouseHover

    Private Sub RadListView1_MouseHover(sender As Object, e As EventArgs)
        Dim pt As Point = Me.RadListView1.PointToClient(MousePosition)
        Dim hoveredCell As DetailListViewCellElement = TryCast(Me.RadListView1.ElementTree.GetElementAtPoint(pt), DetailListViewCellElement)
        If hoveredCell IsNot Nothing Then
            Dim form As New RadForm()
            form.Text = hoveredCell.Text
            form.Show()
        End If 
    End Sub

Off topic, since you mentioned that you are converting your business app, please have in mind that Telerik UI for WinForms offers a WinForms Converter. This tool allows you to convert the standard .NET Windows Forms controls for all projects in a particular solution to their equivalent in Telerik UI for WinForms. It aims to speed up the conversion process and save time when such projects are modernized. 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Principal
Progress Telerik

Love the Telerik and Kendo UI products and believe more people should try them? Invite a fellow developer to become a Progress customer and each of you can get a $50 Amazon gift voucher.

Tags
ListView
Asked by
Willy
Top achievements
Rank 2
Iron
Iron
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or