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

right to left problem Treeview in combo box

2 Answers 46 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Usman
Top achievements
Rank 1
Usman asked on 24 Jan 2010, 07:07 AM
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 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 25 Jan 2010, 07:40 AM
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.
0
Usman
Top achievements
Rank 1
answered on 25 Jan 2010, 01:14 PM
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";

 

 

 

}

 

 

 

 

 

Tags
TreeView
Asked by
Usman
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Usman
Top achievements
Rank 1
Share this question
or