€ character

4 posts, 0 answers
  1. Michael Hilgers
    Michael Hilgers avatar
    76 posts
    Member since:
    Apr 2010

    Posted 12 Apr 2013 Link to this post

    Hello everyone,

    i'm using some RadRichTextBoxes in my application.

    Because we're in the European Union, we need the character "€" for currency values like "110,23€".

    But for me and my customers, it's not possible to insert a € character into the TextBoxes with the key shortcuts "Ctrl+Alt+E" or "AltGr+E" (which are the standard for inserting € characters on european keyboard layouts).

    How can i modify the behaviour of the TextBoxes so that these standard values are accepted? But i think a cleaner and better solution would be a native support for the € character by Telerik itself because it's a standard character in Europe like the $ character in the US.

    Regards,
    Michael
  2. Svett
    Admin
    Svett avatar
    728 posts

    Posted 16 Apr 2013 Link to this post

    Hello Michael,

    Thank you for writing.

    You can achieve the desired behavior by creating a custom input handler in the following manner:
    public class MyInputBehavior : InputBehavior
    {
        public MyInputBehavior(DocumentView view)
            : base(view)
        {
     
        }
     
        protected override bool ProcessKeyDownCore(System.Windows.Forms.KeyEventArgs e)
        {
            if (e.Control && e.Alt && e.KeyCode == System.Windows.Forms.Keys.E)
            {
                this.DocumentView.Insert("€");
                return false;
            }
     
            return base.ProcessKeyDownCore(e);
        }
    }

    Then you should replace the default instance in the following way:
    this.radRichTextBox1.DocumentView.InputBehavior = new MyInputBehavior(this.radRichTextBox1.DocumentView);

    I will consider your suggestion as feature request. You can track its status in our public issue tracking system.

    I updated your Telerik points.

    Greetings,
    Svett
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Michael Hilgers
    Michael Hilgers avatar
    76 posts
    Member since:
    Apr 2010

    Posted 16 Apr 2013 Link to this post

    Hello Svett ,

    thanks for the reply. Your suggested solution is nearly correct.

    Doing it the way you suggest, i get two € characters insted of one when pressing the key combination just once.

    I changed the function like this and all works fine:
    protected override bool ProcessKeyDownCore(System.Windows.Forms.KeyEventArgs e)
            {
                if (e.Control && e.Alt && e.KeyCode == System.Windows.Forms.Keys.E)
                {
                    //this.DocumentView.Insert("€");
                    return false;
                }
     
                return base.ProcessKeyDownCore(e);
            }

    Regards,
    Michael
  5. Svett
    Admin
    Svett avatar
    728 posts

    Posted 19 Apr 2013 Link to this post

    Hi Michael,

    I am glad we sorted this out. Do not hesitate to contact back, if you have further issues with RadConrols for Winforms.

    Greetings,
    Svett
    the Telerik team
    WinForms Q1 2013 boasts PivotGrid, PDF Viewer, Chart enhancements and more. Check out all of the latest highlights.
Back to Top