This is a migrated thread and some comments may be shown as answers.

Right to Left Arrow Keys Problem

1 Answer 129 Views
PageView
This is a migrated thread and some comments may be shown as answers.
Arman
Top achievements
Rank 1
Arman asked on 31 Jul 2014, 03:28 AM
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?

1 Answer, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 04 Aug 2014, 11:24 AM
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.
 
Tags
PageView
Asked by
Arman
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or