Hi Telerik Team,
i begin to developing a telerik UI by using c#. i added a CommandBarDropDownButton for language selection (English & Arabic). When i set currentculture as arabic and RightToLeft to Yes, CommandBarDropDownButton items, are onthe right side of screen, show up shifted position, in a wrong position. i attached the screenshots for clarifying problem.
Here is my code:
using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Globalization;using System.Threading;using System.Windows.Forms;using Telerik.WinControls;using Telerik.WinControls.UI; namespace TelerikWinFormsApp2{ public partial class Form1 : RadForm { private static RightToLeft right2Left = RightToLeft.No; private readonly object _locker = new object(); public static CultureInfo CurrentCulture { get; set; } private RightToLeft Right2Left { get { return right2Left; } set { if (!(right2Left == value)) { lock(_locker){ right2Left = value; CultureChangeFunc(); } } } } public Form1() { InitializeComponent(); } private void Form1_Load(object sender, EventArgs e) { InitializeToolbar(); } private void InitializeToolbar() { bseLayout.Grip.Visibility = ElementVisibility.Collapsed; bseActions1.Grip.Visibility = ElementVisibility.Collapsed; bseLanguage.Grip.Visibility = ElementVisibility.Collapsed; bseLanguage.DesiredLocation = new PointF(10000, 0); this.commandBarDropDownButton2.Image = Image.FromFile("icons\\32x32\\icon_list.png"); this.commandBarDropDownButton3.Image = Image.FromFile("icons\\32x32\\icon_settings.png"); this.commandBarDropDownButton4.Image = Image.FromFile("icons\\32x32\\icon_lang.png"); this.commandBarButton7.Image = Image.FromFile("icons\\32x32\\icon_info.png"); this.commandBarButton4.Image = Image.FromFile("icons\\32x32\\icon_help.png"); } private void rmiLanguage_Click(object sender, EventArgs e) { var selectedItem = (RadMenuItem)sender; if (selectedItem.Tag == null) return; try { if (selectedItem.Tag.Equals("rmiEnglish")) { CurrentCulture = new CultureInfo("en-US"); Right2Left = RightToLeft.No; } else if (selectedItem.Tag.Equals("rmiArabic")) { CurrentCulture = new CultureInfo("ar-SA"); Right2Left = RightToLeft.Yes; } else { return; } } catch (Exception ex) { MessageBox.Show("Change Language Error : "+ ex.Message.ToString()); } } private void CultureChangeFunc() { try { Thread.CurrentThread.CurrentCulture = CurrentCulture; Thread.CurrentThread.CurrentUICulture = CurrentCulture; RightToLeft = Thread.CurrentThread.CurrentCulture.TextInfo.IsRightToLeft ? RightToLeft.Yes : RightToLeft.No; } catch (Exception ex) { MessageBox.Show("Change Language Error : ", ex.Message.ToString()); } } }}
Best Regards..
