Completed
Last Updated: 28 Nov 2017 06:45 by ADMIN
ADMIN
Dess | Tech Support Engineer, Sr.
Created on: 10 Nov 2017 13:08
Category:
Type: Bug Report
3
FIX. RadListView - pressing Shift+Enter always closes the editor although it is multiline
To reproduce: populate RadListView with data and enable editing. Allow multiline text for the editor

        private void radListView1_EditorInitialized(object sender, Telerik.WinControls.UI.ListViewItemEditorInitializedEventArgs e)
        {
            ListViewTextBoxEditor editor = e.Editor as ListViewTextBoxEditor;
            if (editor!=null)
            {
                editor.Multiline = true;
                editor.AcceptsReturn = true;
            }
        }

Workaround:
        private void radListView1_EditorRequired(object sender, ListViewItemEditorRequiredEventArgs e)
        {
             e.Editor = new CustomListViewTextBoxEditor();
        }


        public class CustomListViewTextBoxEditor : ListViewTextBoxEditor
        {
            protected override void OnKeyDown(KeyEventArgs e)
            {
                if (e.KeyCode== Keys.Enter && e.Modifiers== Keys.Shift)
                {
                    return;
                }
                base.OnKeyDown(e);
            }
        }
0 comments