Hello Michael,
A possible approach is to use the
BeginningEdit event to cancel the edit of the cell, when the double click occurs. In order to do that you can do the following:
1) set two Boolean flags(
isEditMouseInitiated and
isDoubleClick). Where
isEditMouseInitiated and
isDoubleClick are used to indicate, respectively that an edit operation was initiated by a mouse activity and you have a double click.
2) add a handlers for the
MouseDoubleClickEvent and MouseLeftButtonUpEvent events, to set the Boolean flags to the appropriate values - isDoubleClick is set to false, when the MouseDoubleClickEvent event triggers and the isEditMouseInitiated is set to true, when the MouseLeftButtonUpEvent triggers.
3) use a DispatcherTimer in the BeginingEdit event handler to set an interval of time and attach an event handler to it's Tick event to detect if a second click has occurred. If the isDoubleClick flag or the IsEnabled property of the DispatcherTimer are set to false the GridView will not enter edit mode.
Also, I attached a sample project that demonstrates the suggested approach.
I hope this helps.
Regards,
Boris Penev
Telerik
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time.
Watch the videos and start improving your app based on facts, not hunches.