Some Shortcut Keys not working in RadTextBox

2 posts, 0 answers
  1. Alan
    Alan avatar
    8 posts
    Member since:
    Sep 2011

    Posted 31 Jan 2012 Link to this post

    Ctrl+A (Select All)
    Ctr+Y (Redo)
    are not working in RadText Boxes.
    Also, is there a way to change the undo being  done in RadTextBoxes to be a character at a time.
  2. Stefan
    Stefan avatar
    2908 posts

    Posted 02 Feb 2012 Link to this post

    Hi Alan,

    Thank you for writing.

    Indeed, RadTextBox currently does not support redo operation. However, undo and select all are available and the undo functionality works exactly the way the standard MIcrosoft text box does. Your suggestions for the redo operation and for the undo per character functionality are quite reasonable and this is why I will add them as feature requests in our PITS system. At the following links, you can add your vote for these requests:

    Meanwhile, please refer to the following snippet, which demonstrates how to achieve the desired behavior with a stack:
    public partial class Form1 : Form
        Stack<string> undoStack = new Stack<string>();
        Stack<string> redoStack = new Stack<string>();
        public Form1()
            radTextBox1.TextChanged += new EventHandler(radTextBox1_TextChanged);
            radTextBox1.KeyDown += new KeyEventHandler(radTextBox1_KeyDown);
        bool preventUpdate = false;
        void radTextBox1_KeyDown(object sender, KeyEventArgs e)
            if (e.Control && e.KeyCode == Keys.Y && redoStack.Count > 0)
                radTextBox1.Text = redoStack.Pop();
            if (e.Control && e.KeyCode == Keys.Z && undoStack.Count > 0)
                string str = undoStack.Pop();
                int caretPosition = radTextBox1.SelectionStart;
                preventUpdate = true;
                radTextBox1.Text = str;
                radTextBox1.SelectionStart = caretPosition;
                preventUpdate = false;
        void radTextBox1_TextChanged(object sender, EventArgs e)
            if (!preventUpdate)
                RadTextBox textBox = (RadTextBox)sender;

    I hope that the provided information addresses your question. Your Telerik points have been updated for this feature request.
    the Telerik team

    SP1 of Q3’11 of RadControls for WinForms is available for download (see what's new).

Back to Top