TreeViewExItem KeyDown problem

Nov 28, 2014 at 12:59 PM
Hi,
We are using TreeViewEx control for some time and found it very useful.
Recently we discovered a bug that seems to be in the control. In TreeViewExItem class there's an event handler OnKeyDown where in case of ENTER key handling the following code is executed:
case Key.Return:
   StopEditing();
   e.Handled = true;
   break;
As far as I understand it this should finalize node rename event. It looks fine however the consequences are quite nasty because if the node is not in the edit mode the control grabs the ENTER key anyway. In our application under the enter key we would like to open the editor for selected node (similar to Visual Studio behaviour) but this code makes it impossible.
There's a simple and I believe logical fix:
case Key.Return:
   if(StopEditing())
      e.Handled = true;
   break;
So we are handling ENTER only if we need to do this i.e. we are in the node edit mode. Of course this requires additional change in StopEditing method signature and ParentTreeView.IsEditingManager.StopEditing() method itself but these are very simple and straightforward changes.
I've tested it and seems to be working without any issues. So I think it would be useful to commit such change on your repository. I could send you SVN patch file with all required changes if it help you.

Thanks,
Pawel
Dec 2, 2014 at 10:21 PM
Hi @pkoselski,
I would like to include those fixes to my fork. Can you please post a patch?
Dec 5, 2014 at 11:06 AM
Sorry for delayed response. Here you can find the patch file:
http://tinyurl.com/TreeViewEx-patch