Grid cell goes into edit mode on mouse down instead of mouse up

2 posts, 0 answers
  1. Valerie
    Valerie avatar
    36 posts
    Member since:
    Nov 2011

    Posted 11 Apr 2013 Link to this post

    I have a problem where the edit mode is conflicting with the drag/drop. The problem happens because the cell goes into edit mode when the mouse is depressed rather than on a mouse up.

    The scenario is that the user has clicked on a row. They happen to have clicked in some random cell. Now they want to drag that row. They click in the same cell expecting that they can drag the row but as soon as they press the mouse down, that cell goes into edit mode. So they can't drag.

    Is there a way to tell the grid to use mouse-up rather than mouse-down when deciding whether to put it in edit mode.

    Thank you,
    Valerie
  2. Nedyalko Nikolov
    Admin
    Nedyalko Nikolov avatar
    871 posts

    Posted 16 Apr 2013 Link to this post

    Hi,

    You could achieve your scenario with changing a little bit radGridView.EditTriggers flag enumeration. By default RadGridView starts editing after following actions (press F2, CurrentCellClick, TextInput). I think that if you set radGridView.EditTriggers = "F2, TextInput" you will get the desired result. That way RadGridView will not be able to enter into edit mode with a mouse action. Since this is a little bit strange for end users you can solve this with a few lines of code (just add a ClassHandler for GridViewCell.MouseDoubleClickEvent (or any event you find appropriate)). I'm attaching a sample project that demonstrates the approach with MouseDoubleClick event.
    Let me know if this does not help.

    Greetings,
    Nedyalko Nikolov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top