Text Direction in RadTextBox

3 posts, 0 answers
  1. Mayrun Digmi
    Mayrun Digmi avatar
    2 posts
    Member since:
    Aug 2008

    Posted 12 Aug 2008 Link to this post

    Hello
    I'm pleased to be a registered user of the rad controls pack.

    I have a page with few RadTextBoxes on it,
    I would like to know how can I change the default text direction to be RTL instead of LTR in both MultiLine and SingleLine textmodes.

    Thanks alot guys,
    Mayrun Digmi.
  2. Plamen Peshev
    Admin
    Plamen Peshev avatar
    886 posts

    Posted 13 Aug 2008 Link to this post

    Hello Mayrun,

    You can use dir attrubute. The dir attribute specifies the base direction of text in all HTML elements. Feasible values of the dir attribute are LTR (left-to-right, default) and RTL (right-to-left).

    Here is an example:

    <%@ Page Language="C#" %> 
     
    <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
     
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> 
    <html xmlns="http://www.w3.org/1999/xhtml"
    <head runat="server"
        <title>Untitled Page</title> 
        <script runat="server"
            protected void Page_Load(object sender, EventArgs e) 
            { 
                RadTextBox1.Attributes["dir"] = "rtl"; 
                RadTextBox2.Attributes["dir"] = "rtl"; 
            }         
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"
            <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
            <div>             
                <telerik:RadTextBox ID="RadTextBox1" runat="server" > 
                </telerik:RadTextBox> 
                <telerik:RadTextBox ID="RadTextBox2" runat="server"  TextMode="MultiLine"
                </telerik:RadTextBox>             
            </div> 
        </form> 
    </body> 
    </html> 
     




    Regards,
    Plamen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mayrun Digmi
    Mayrun Digmi avatar
    2 posts
    Member since:
    Aug 2008

    Posted 14 Aug 2008 Link to this post

    Thank you my friend, you've been very helpful.
Back to Top