Get the index of the line pointed by mouse

2 posts, 0 answers
  1. Brice
    Brice avatar
    1 posts
    Member since:
    Feb 2015

    Posted 25 Aug Link to this post

    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

  2. Dimitar
    Admin
    Dimitar avatar
    1404 posts

    Posted 25 Aug Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top