Approved
Last Updated: 30 Mar 2016 13:36 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 17 Feb 2015 08:44
Category: TreeView
Type: Bug Report
0
FIX. RadTreeView - multiline TreeViewTextBoxEditor does not allow you to insert a new line
To reproduce:

1. Add a RadTreeView with several nodes
2. Subscribe to the EditorRequired event and specify the editor to TreeViewTextBoxEditor where its Multiline property is set to true.
3. Select a node and press F2. The editor is activated. However, when you enter some text and press Ctrl+Enter, the editor is closed. The expected behavior is that a new line is inserted.

Workaround:

private void radTreeView1_EditorRequired(object sender, TreeNodeEditorRequiredEventArgs e)
{
    CustomTreeViewTextBoxEditor editor = new CustomTreeViewTextBoxEditor();
    editor.Multiline = true;
    e.Editor = editor;
}

public class CustomTreeViewTextBoxEditor : TreeViewTextBoxEditor
{
    protected override void OnKeyDown(KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter &&
            e.Modifiers == Keys.Control &&
            this.Multiline)
        {
            return;
        }
        base.OnKeyDown(e);
    }
}
(Total attached files size should be smaller than 20mb. Allowed extensions: .zip, .rar, .jpg, .png, .gif)
0 comments