right to left problem Treeview in combo box

3 posts, 0 answers
  1. Usman
    Usman avatar
    18 posts
    Member since:
    Oct 2008

    Posted 24 Jan 2010 Link to this post

    hi

    i have a tree in combo box.i need right to left support for tree inside a combo box.example when i click on english button tree view nodes should display in left to right inside a tree,when i clcik on arabic button the same tree nodes should display in right to left.any help please.

    thanks
    usman
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Jan 2010 Link to this post

    Hello Usman,

    I tried following code snippet for a similar scenario of setting the direction for thetreeview on clicking a button.

    CS:
     
        protected void Button1_Click(object sender, EventArgs e) 
        { 
            RadTreeView tree = (RadTreeView)RadCombo1.Items[0].FindControl("RadTreeView1"); 
            tree.Attributes.Add("dir","rtl"); // Setting direction 
            tree.DataBind(); 
        } 
        protected void Button2_Click(object sender, EventArgs e) 
        { 
            RadTreeView tree = (RadTreeView)RadCombo1.Items[0].FindControl("RadTreeView1"); 
            tree.Attributes.Add("dir""ltr"); // Setting direction 
            tree.DataBind(); 
        } 

    -Shinu.
  3. Usman
    Usman avatar
    18 posts
    Member since:
    Oct 2008

    Posted 25 Jan 2010 Link to this post

    Hello Shinu

    thanks for ur reply.i tried ur code but its not working, i work on this its working in different way.i m creating 2 css files[testEn,testAr] while click on buttons i m changing the css files its working fine.

    here is the code 

    .testEn

    {

         background-color:Aqua ;

         

    text-align:left;

     

         

    direction:ltr;

     

         

    height: 600px;

     

         

    width: 100%;

     

     

     }

     

     

     

    .testAr

     

    {

     

         

    direction:rtl;

     

         

    text-align:right;

     

         

    background-color:Gray ;

     

         

    height: 600px;

     

         w

    idth: 100%;

     

     

     }

    in code behind 
     

     

     

    protected

     

    void Button1_Click(object sender, EventArgs e)

     

     

     {

        RCBFLD151.Attributes.Add(

    "dir", "ltr");

     

     

     

       RadTreeView tree = (RadTreeView)RCBFLD151.Items[0].FindControl("RadTreeView1");

     

     

     

       tree.CssClass = "testEn";

     

     

     

    }

     

     

    protected void Button2_Click(object sender, EventArgs e)

     {

          RCBFLD151.Attributes.Add(

    "dir", "rtl");

     

     

     

     

        RadTreeView tree = (RadTreeView)RCBFLD151.Items[0].FindControl("RadTreeView1");

     

     

     

        tree.CssClass = "testAr";

     

     

     

    }

     

     

     

     

     

Back to Top