How to setup culture, right-to-left dynamically?

3 posts, 1 answers
  1. Wei
    Wei avatar
    33 posts
    Member since:
    Oct 2008

    Posted 04 Nov 2008 Link to this post

    In my project I need to set right to left at page load time. Is there a way to access RADControl collection on current page so I can use a general function to set all controls’ RTL property?

    Here is my unsuccessful code snippet:


            protected void Page_Load(object sender, EventArgs e)  
                //testing Right-to-left layout for Rad Control  
            protected void SetRControlsRightToLeftLayout(Control context, bool isSetRightToLeft)  
                foreach (Control c in context.Controls)  
                    Control rControl = c as Control;//RadControl rControl = c as RadControl;  
                    if (rControl != null)  
                        if (rControl.GetType().ToString().StartsWith("Telerik.Web.UI",StringComparison.Ordinal))  
                        if (rControl.HasControls())  
                            SetRControlsRightToLeftLayout(rControl, isSetRightToLeft);  

  2. Answer
    Blaize avatar
    88 posts
    Member since:
    Oct 2006

    Posted 05 Nov 2008 Link to this post

    Hey Wei,
    What about

    rControl.Attributes["dir"] = "rtl";


  3. Waleed Seada
    Waleed Seada avatar
    241 posts
    Member since:
    May 2006

    Posted 25 Nov 2009 Link to this post

    Hello Blaize,

    I can't see where to put the <rControl.Attributes["dir"] = "rtl";> in the code, I get cannot resolve symbol error message.

    Best regards.
Back to Top