Bug Report T284760
Visible to All Users

TreeList - Arrow keys are not working if an editor was activated with the F2 key

created 10 years ago

I have a treelist that each column, optionsColumn.AllowEdit is set to false.

on a right click you can choose to rename that column at which point optionsColumn.AllowEdit is set to true and i call treelist.showeditor().

The column text comes up fully hightlighted.  I must use my mouse or click spacebar and delete the text to start editing.

How can I show the field in an editing mode, where I can just use my right/left keys and not use mouse, like you can do in Window Explorer.    I tried it with the latest version to see if we needed to upgrade, but it seems to work just the same in that build as well.

Thank you

Comments (3)
Alisher (DevExpress Support) 10 years ago

    Hi Kristina,

    Do I understand it correctly that you wish an in-place editor to be activated after you select a specific context menu item and press the right/left arrow keys? If so, it is unclear how you plan to determine when the editor should not be activated on the next attempt to invoke it.

    KS KS
    Kristina Schaeffer 1 9 years ago

      Do me a favor, open a file in your Windows Directory, highlight it to rename, what happens when you use your left and right arrows.  Do the same in Excel.  Highlight a cell and then use your right and left arrow.  You stay on that item because you are editing it.  The arrow keys start moving inside the words.  Now try that same thing in a TreeList.  You can not.

      LF LF
      Leonardo Francisco 1 9 years ago

        Hi Kristina,
        I solved this way:

        C#
        private void TreeList_ShownEditor(object sender, EventArgs e) { TextEdit editor = this.ActiveEditor as TextEdit; if (editor != null) { editor.ReadOnly = false; editor.KeyUp += (s, x) => { switch (x.KeyCode) { case Keys.Enter: case Keys.Tab: this.CloseEditor(); this.RefreshNode(this.FocusedNode); x.Handled = true; break; case Keys.Left: if (x.Modifiers == Keys.None && !string.IsNullOrEmpty(editor.SelectedText)) { editor.SelectionLength = 0; x.Handled = true; } break; case Keys.Right: if (x.Modifiers == Keys.None && !string.IsNullOrEmpty(editor.SelectedText)) { editor.SelectionStart += editor.SelectedText.Length; editor.SelectionLength = 0; x.Handled = true; } break; } }; } }

        Answers approved by DevExpress Support

        created 9 years ago

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

          Comments (2)
          KS KS
          Kristina Schaeffer 9 years ago

            Thank You!

            Alisher (DevExpress Support) 9 years ago

              You are welcome! :)

              created 9 years ago

              Hi Kristina,

              Thank you for the clarification.

              To resolve the issue, set TreeList's OptionsNavigation.MoveOnEdit proeprty to False.

              Let me know if you have additional qeustions.

                Show previous comments (2)
                Alisher (DevExpress Support) 9 years ago

                  Hi Kristina,

                  Thank you for the clarification and the example project. Now the issue is clear. I have passed it to our developers for further research. We will inform you of our progress. Pleae stay tuned.

                  CM CM
                  Chad Morreale 1 7 years ago

                    This issue was not resolved correctly.  When you go into edit mode on a tree node and then right arrow, the cursor should move to the end of the node name string.  With this update it moves to the beginning of the node name string on right arrow.  It should only move to the beginning of the string if you left arrow or hit the home key.  Right arrow and end should move the cursor to the end of the string.

                    Nadezhda (DevExpress Support) 7 years ago

                      Hello,

                      I've created a separate ticket on your behalf (TreeList - The cell cursor is set to the beginning of the cell when the right arrow is pressed). It has been placed in our processing queue and will be answered shortly.

                      Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                      Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.