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
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.
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.
Hi Kristina,
I solved this way:
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; } }; } }