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

Get the index of the line pointed by mouse

1 Answer 64 Views
MultiColumn ComboBox
This is a migrated thread and some comments may be shown as answers.
Brice
Top achievements
Rank 1
Brice asked on 25 Aug 2016, 09:45 AM

Hi

i try to get the index of the line I point with the mouse when the list of the multicomulmncombobox is opened and the line is not selected yet.

How can I do that?

thanks

1 Answer, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 25 Aug 2016, 11:46 AM
Hello Brice,

Thank you for writing.

If I understand correctly you want to get the hovered row index. This can be achieved by using the MouseMove event of the underlying grid: 
// Subscribe to the event like this
radMultiColumnComboBox1.EditorControl.MouseMove += EditorControl_MouseMove;
 
//Get the hovered element
private void EditorControl_MouseMove(object sender, MouseEventArgs e)
{
    var element = radMultiColumnComboBox1.EditorControl.ElementTree.GetElementAtPoint(e.Location);
    if (element is GridDataCellElement)
    {
        var cell = element as GridDataCellElement;
        Console.WriteLine(cell.RowInfo.Index);
    }
}

I hope this will be useful. 

Regards,
Dimitar
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
MultiColumn ComboBox
Asked by
Brice
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Share this question
or