how to change direction of column for gridview from ltr to rtl

Posted by Skaftabali under ASP.NET on 10/26/2010 | Points: 10 | Views : 6859 | Status : [Member] | Replies : 3
Hi ,


I developed a application for English end Arabic.
In this Application i am using gridview.
I want when i click arabic button my gridview column will be RTL.Pls giude me and pls give proper link and solution.
in this application i create two css one for English,another for Arabic.
I wrote a css for grid view


.GVLeftIndex
{
padding-left:50px;
margin:5px;
height:23px;
text-align:left;
}
.gridalign
{
width:auto;
text-align:center;
padding-right:15px;
padding-left:15px;
}




Responses

Posted by: Lalji_mer on: 10/26/2010 [Member] Bronze | Points: 25

Up
0
Down
try following code sample.
<table border="0" cellpadding="0" cellspacing="0">


<tr>

<td dir="rtl">

<%--your gridview code here --%>


</td>

</tr>

</table>


LP MER

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Skaftabali on: 10/26/2010 [Member] Starter | Points: 25

Up
0
Down
if i will be use dir=rtl it is for Arabic in Table.
for english when and where i use

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: T.saravanan on: 10/26/2010 [Member] [MVP] Silver | Points: 25

Up
0
Down
Hi,

In button click using the following code i think its working fine.


For Right to Left
GridView1.Style[ HtmlTextWriterStyle.Direction] = "rtl";
GridView1.Rows[0].Cells[1].Style[ HtmlTextWriterStyle.Direction] = "rtl"; --> Particular Cell

For Left to Right
GridView1.Style[ HtmlTextWriterStyle.Direction] = "ltr";
GridView1.Rows[0].Cells[1].Style[ HtmlTextWriterStyle.Direction] = "ltr";


http://forums.asp.net/p/1117791/3607179.aspx --> For your Reference


Cheers :)

Thanks,
T.Saravanan

Skaftabali, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response