This is a migrated thread and some comments may be shown as answers.

Reference to ListDataItem the mouse is over

1 Answer 20 Views
ListControl
This is a migrated thread and some comments may be shown as answers.
Troy
Top achievements
Rank 1
Troy asked on 20 Oct 2013, 10:17 PM
Is there a way to get the ListDataItem object that the mouse is hovering over in a RadListControl?
I've been trying several approach's but been drawing a blank.  I'm thinking the item should already be available somehow since its being highlighted/formatted by the ListControl already...
Thx

1 Answer, 1 is accepted

Sort by
0
Accepted
Stefan
Telerik team
answered on 23 Oct 2013, 04:22 PM
Hello Troy,

Thank you for writing.

Yes, there is a way to do that. Here is how to do it:
void radListControl1_MouseHover(object sender, EventArgs e)
{
    RadListVisualItem visualItem = radListControl1.ElementTree.GetElementAtPoint(radListControl1.PointToClient( MousePosition)) as RadListVisualItem;
 
    if (visualItem != null)
    {
        RadListDataItem dataItem = visualItem.Data;
    }
}

I hope this helps.

Regards,
Stefan
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WINFORMS.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ListControl
Asked by
Troy
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or