Hovering over a row in a radgridview

5 posts, 1 answers
  1. Yonatan
    Yonatan avatar
    6 posts
    Member since:
    Aug 2012

    Posted 27 Aug 2012 Link to this post

    Hello,

    I'm trying to get a message containing the row info every time the mouse hovers over the row in the radgridview. The message content doesn't disturb me at this point, my problem is that I can't find  a mousehover() event or something of this sort. Can you help me?
  2. Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 27 Aug 2012 Link to this post

    Hello,

     You can set a Tooltip. Please check this help article that shows how to add ToolTip to rows. 

    Kind regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  3. Yonatan
    Yonatan avatar
    6 posts
    Member since:
    Aug 2012

    Posted 27 Aug 2012 Link to this post

    Hi Didie,

    Thanks for the reply. The tooltip is not good for me, as I want something completely different:

    I have a map along the gridview (every row in the gridview represents a different part of the map),
    , and I want the map part that is represented by the row the mouse is hovering on to glow until the mouse moves away from the row.

    For that I need a mousehover() event or mouserowhover() event or  something like that. Does the RadGridViw have something like that?
     
  4. Answer
    Dimitrina
    Admin
    Dimitrina avatar
    3769 posts

    Posted 28 Aug 2012 Link to this post

    Hi,

     You can subscribe for the MouseEnter and MouseLeave events of the GridViewRow and use them:

    void playersGrid_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
    {
        var row = e.Row as GridViewRow;
        
        if (row != null)
        {
            row.MouseEnter += new System.Windows.Input.MouseEventHandler(row_MouseEnter);
            row.MouseLeave += new System.Windows.Input.MouseEventHandler(row_MouseLeave);
        }
    }

    void playersGrid_RowUnloaded(object sender, Telerik.Windows.Controls.GridView.RowUnloadedEventArgs e)
    {
        var row = e.Row as GridViewRow;
        
        if (row != null)
        {
            row.MouseEnter -= newSystem.Windows.Input.MouseEventHandler(row_MouseEnter);
            row.MouseLeave -= newSystem.Windows.Input.MouseEventHandler(row_MouseLeave);
        }
    }

    Regards,
    Didie
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

  5. Yonatan
    Yonatan avatar
    6 posts
    Member since:
    Aug 2012

    Posted 04 Sep 2012 Link to this post

    Thanks a million - it was just the thing I was looking for.
Back to Top