Right to Left Arrow Keys Problem

2 posts, 0 answers
  1. Arman
    Arman avatar
    2 posts
    Member since:
    Apr 2014

    Posted 30 Jul 2014 Link to this post

    I have a RadPageview in Strip Mode and I want my program to had support a right-to-left language. When I changing the Right-to-Left Property to true it works fine. but when I run my program and use Arrow Keys (Left or Right) it doesn't work correctly. Left key goes to Right and Right key goes to Left. How can I fix it?
  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 04 Aug 2014 Link to this post

    Hello Arman,

    Thank you for writing.

    I confirm that arrow keys navigation in RadPageView with RightToLeft support should behave similar to MS TabControl in RightToLeft mode. I have logged it in our Feedback Portal. You can track its progress, subscribe for status changes and add your vote/comment to it on the following link - Feedback Item.

    I have also updated your Telerik points.

    Currently, the possible solution that I can suggest is to create a custom RadPageViewStripElement and override its IsNextKey and IsPreviousKey methods on a way to reverse the previous/next navigation as follows:  
    public Form1()
    {
        InitializeComponent();
        this.radPageView1.RightToLeft = System.Windows.Forms.RightToLeft.Yes;
    }
     
    public class CustomPageView : RadPageView
    {
        public override string ThemeClassName 
        {
            get
            {
                return typeof(RadPageView).FullName; 
            }
        }
     
        protected override RadPageViewElement CreateUI()
        {
            switch (this.ViewMode)
            {
                case PageViewMode.Strip:
                    return new CustomRadPageViewStripElement();
                 
                default:
                    return base.CreateUI();
            }
        }
    }
     
    public class CustomRadPageViewStripElement : RadPageViewStripElement
    {
        public CustomRadPageViewStripElement()
        {
        }
     
        protected override Type ThemeEffectiveType    
        {
            get   
            {
                return typeof(RadPageViewStripElement);    
            }
        }
     
        protected override bool IsNextKey(Keys key)
        {
            if (this.RightToLeft)
            {
                if (key == Keys.Left)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
     
            return base.IsNextKey(key);
        }
     
        protected override bool IsPreviousKey(Keys key)
        {
            if (this.RightToLeft)
            {
                if (key == Keys.Right)
                {
                    return true;
                }
                else
                {
                    return false;
                }
            }
            return base.IsPreviousKey(key);
        }
    }

    I hope this information helps. Should you have further questions, I would be glad to help.

    Regards,
    Desislava
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top