Handle the Double Click

5 posts, 1 answers
  1. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 06 May 2011 Link to this post

    Good Day

    Is there a way to handle a Double click on a Datagrid row ?

    Thanks
  2. Vuyiswa Maseko
    Vuyiswa Maseko avatar
    187 posts
    Member since:
    Jan 2010

    Posted 06 May 2011 Link to this post

    Sorry Guys for posting without checking the grid events. i found the exact event for Double Click.

    Thanks
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Answer
    Emanuel Varga
    Emanuel Varga avatar
    1336 posts
    Member since:
    May 2010

    Posted 06 May 2011 Link to this post

    Hello Vuyiswa Maseko,

    Are you looking for the Control's main DoubleClick or for the CellDoubleClick?
    I would suggest using the CellDoubleClick event if you want to receive events just from cells.

    Hope this helps, if you have any other questions or comments, please let me know,

    Best Regards,
    Emanuel Varga

    Telerik WinForms MVP
  5. Idris
    Idris avatar
    1 posts
    Member since:
    May 2013

    Posted 13 Nov 2013 Link to this post

    Hi Emanuel
    on CellDoubleClick how to understand it clicked left mouse button or right mouse button?
    it fires both of them.
    thank you
  6. Dimitar
    Admin
    Dimitar avatar
    1411 posts

    Posted 15 Nov 2013 Link to this post

    Hello Idris,

    Thank you for writing.

    There is no way to detect which mouse button is clicked in CellDoubleClick. Nevertheless you can use the MouseDoubleClick and get the corresponding cell there:
    void radGridView1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
        if (e.Button == System.Windows.Forms.MouseButtons.Left)
        {
            GridCellElement cell = radGridView1.ElementTree.GetElementAtPoint(e.Location) as GridCellElement;
            if (cell != null)
            {
                Console.WriteLine(cell.Value);
            }
        }           
    }

    I hope this will be useful. Should you have further questions, I would be glad to help.

    Regards,
    Dimitar
    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 >>
Back to Top
UI for WinForms is Visual Studio 2017 Ready