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

Flow direction issues

7 Answers 59 Views
DateTimePicker
This is a migrated thread and some comments may be shown as answers.
Roy Graham
Top achievements
Rank 1
Roy Graham asked on 13 Jan 2011, 11:44 AM
I am using the date time picker in a multi language application. I have used the cultural support to nicely change the tecxt within the control (apart from the close button and clock header - which I have changed in the template).
However in the right to left languages, when the picker is opened it appears disconnected from the control.
I have tried to adjust the RenderTransformOrigin at various places, but have not managed to alter this behaviour.
(See attached images for visuals in english and arabic)
Any advice?

7 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 17 Jan 2011, 10:41 AM
Hello Roy Graham,

Can you send us the definition of the picker and the arabic culture you are using in your application.

All the best,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Roy Graham
Top achievements
Rank 1
answered on 17 Jan 2011, 11:23 AM
Here is a cut down version that exhibits the problem.
<UserControl x:Class="TelerikTest_Rtl.MainPage"
    xmlns:System="clr-namespace:System;assembly=mscorlib" 
    mc:Ignorable="d"
    Height="300" Width="400">
  
      
    <Grid x:Name="LayoutRoot" Background="White" Margin="30,15,30,15">
        <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto" MinWidth="150"/>
                <ColumnDefinition Width="10"/>
                <ColumnDefinition Width="Auto" MinWidth="150"/>
                <ColumnDefinition Width="*"/>
            </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="25"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="25"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
  
        <TextBlock Grid.Column="0" Grid.Row="0" Text="Description" />
        <TextBox Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="4" x:Name="descBox" />
          
        <TextBlock Grid.Column="0" Grid.Row="2" Text="Date 1" />
        <telerik:RadDateTimePicker Grid.Column="0" Grid.Row="3" x:Name="startBox" Height="26" />
          
        <TextBlock Grid.Column="2" Grid.Row="2" Text="Date 2"/>
        <telerik:RadDateTimePicker Grid.Column="2" Grid.Row="3" x:Name="endBox" Height="26" />
  
        <Button Grid.Column="2" Grid.Row="5" Content="ChangeCulture" Click="Button_Click" />
    </Grid>
</UserControl>

using System.Windows;
using System.Windows.Controls;
using System.Globalization;
using System.Reflection;
  
namespace TelerikTest_Rtl
{
    public partial class MainPage : UserControl
    {
        private bool isArabic = false;
  
        public MainPage()
        {
            InitializeComponent();
        }
  
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            string code = "en-GB";
            isArabic = !isArabic;
            if (isArabic)
            {
                code = "ar-AE";
            }
            CultureInfo ci = new CultureInfo(code);
            endBox.Culture = ci;
            startBox.Culture = ci;
            ApplyFlowDirection(isArabic);
        }
  
        private void ApplyFlowDirection(bool isRTL)
        {
            var d = LayoutRoot as DependencyObject;
            PropertyInfo pInfo = d.GetType().GetProperty("FlowDirection");
  
            if (pInfo == null)
                return;
            FlowDirection flow = (isRTL) ? FlowDirection.RightToLeft : FlowDirection.LeftToRight;
            pInfo.SetValue(d, flow, null);
        }
    }
}

No style changes applied. Using ar-AE to produce the culture.
0
Kaloyan
Telerik team
answered on 19 Jan 2011, 01:45 PM
Hi Roy Graham,

I am attaching some images of a test app with your code included in it. I can't see any problems with the popup location in the arabic culture. Can you confirm if the same view is at your site.

Best wishes,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Roy Graham
Top achievements
Rank 1
answered on 02 Feb 2011, 05:03 PM
Sorry for the delay in replying, I got bumped into some other work.

The two images you posted show the exact issue. (THe extent of the problem depends on screen sizes etc).
In the english version the week number column is aligned with the start of the date entry field.
In the arabic version it has shifted to starting almost at the end of the date entry field.

(I would summize that the transform origin is being set some point away from the horizontal centre of the pop-up. I did try and set this myself but it had no effect.)
0
Kaloyan
Telerik team
answered on 04 Feb 2011, 09:23 AM
Hello Roy Graham,

The issue appears when zooming the browser. We will log the issue in our TFS system an try to fix it as soon as possible.

Best wishes,
Kaloyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
Mike
Top achievements
Rank 1
answered on 26 Apr 2011, 12:06 PM
Hi,
Can you let me know if there is an expected date on when this issue is to be resolved.
Many Thanks
Mike
0
Yana
Telerik team
answered on 29 Apr 2011, 03:38 PM
Hello Mike,

I'm afraid that we cannot commit a specific date for resolving this issue as it appeared to be more complicated than we initially thought. We're sorry for the inconvenience.

Greetings,
Yana
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
DateTimePicker
Asked by
Roy Graham
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Roy Graham
Top achievements
Rank 1
Mike
Top achievements
Rank 1
Yana
Telerik team
Share this question
or