You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've implemented behavior when pressing left or right when editing a cell for WinForms.
I wanted to implement it for WPF and Android as well, but I couldn't get it compiling. I did change project settings for #WPF, but I seems there's more to it.
I'm also not really familiar with Git. I'm a mercurial user and not really active in online repos. So I had a bit of trouble attempting to get this code to you. So instead posting it below in the issue.
If you're interested in adding this change; replacing the OnKeyDown method of the InputTextBox in the WinForms control of Reogrid with the code below should do the trick. I guess it's peanuts for you to implement the same behavior in WPF and android as well.
I also want to point out that default Excel behavior when pressing "ENTER" while editing a cell will move the selection to the cell below. In your behavior you move to the right. Of course I don't know how literally you want to mimic Excel with these kind of behaviors?
Thanks!
protectedoverridevoidOnKeyDown(KeyEventArgse){varsheet=owner.currentWorksheet;if(sheet.currentEditingCell!=null&&Visible){boolisProcessed=false;// in single line textif(!TextWrap&&Text.IndexOf('\n')==-1){isProcessed=true;if(e.KeyCode==Keys.Up){ProcessSelectionMoveKey(e,sheet,()=>sheet.MoveSelectionUp());}elseif(e.KeyCode==Keys.Down){ProcessSelectionMoveKey(e,sheet,()=>sheet.MoveSelectionDown());}elseif(e.KeyCode==Keys.Left&&SelectionStart==0){ProcessSelectionMoveKey(e,sheet,()=>sheet.MoveSelectionLeft());}elseif(e.KeyCode==Keys.Right&&SelectionStart==Text.Length){ProcessSelectionMoveKey(e,sheet,()=>sheet.MoveSelectionRight());}else{isProcessed=false;}}if(!isProcessed){if(!Toolkit.IsKeyDown(Win32.VKey.VK_CONTROL)&&e.KeyCode==Keys.Enter){ProcessSelectionMoveKey(e,sheet,()=>sheet.MoveSelectionRight());}}}}privatevoidProcessSelectionMoveKey(KeyEventArgse,Worksheetsheet,ActionmoveAction){e.SuppressKeyPress=true;sheet.EndEdit(Text);moveAction();}
The text was updated successfully, but these errors were encountered:
Thanks! Welcome to fork and submit any your changes to this repository of source code.
I've implemented behavior when pressing left or right when editing a cell for WinForms.
I wanted to implement it for WPF and Android as well, but I couldn't get it compiling. I did change project settings for #WPF, but I seems there's more to it.
You can just open the ReoGridWPF.sln solution to build WPF edition. And open the ReoGridAndroid.sln to build Android edition.
Android build requires Xamarin development environment and runtime.
And make sure you are on the develop branch and use the latest source code.
I also want to point out that default Excel behavior when pressing "ENTER" while editing a cell will move the selection to the cell below. In your behavior you move to the right. Of course I don't know how literally you want to mimic Excel with these kind of behaviors?
You can set the movement direction by using this property:
I applied the change in my own fork and created pull request #16. I hope I did it correctly.
I completely missed the setting you refer to! Thanks. That covers what I need, aside that it had inconsistent behavior between navigating cells and editing a cell. The pull request fixes that as well.
Hi,
I've implemented behavior when pressing left or right when editing a cell for WinForms.
I wanted to implement it for WPF and Android as well, but I couldn't get it compiling. I did change project settings for #WPF, but I seems there's more to it.
I'm also not really familiar with Git. I'm a mercurial user and not really active in online repos. So I had a bit of trouble attempting to get this code to you. So instead posting it below in the issue.
If you're interested in adding this change; replacing the OnKeyDown method of the InputTextBox in the WinForms control of Reogrid with the code below should do the trick. I guess it's peanuts for you to implement the same behavior in WPF and android as well.
I also want to point out that default Excel behavior when pressing "ENTER" while editing a cell will move the selection to the cell below. In your behavior you move to the right. Of course I don't know how literally you want to mimic Excel with these kind of behaviors?
Thanks!
The text was updated successfully, but these errors were encountered: