如何将gridview的列方向从ltr更改为rtl [英] how to change direction of column for gridview from ltr to rtl

查看:213
本文介绍了如何将gridview的列方向从ltr更改为rtl的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我为英语结束阿拉伯语开发了一个应用程序。在这个应用程序中我使用gridview。



我想要点击阿拉伯语按钮时我的gridview列将是RTL.Pls giude me并请给出正确的链接和解决方案。在这个应用程序中,我创建了两个用于英语的CSS,另一个用于阿拉伯语。



我为网格视图写了一个CSS:

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;
}

推荐答案

在阿拉伯语按钮点击事件中调用 GVLeftIndex

Call the GVLeftIndex in arabic button click event.
//sample
public void IncludeCss(string Url) {
            HtmlGenericControl hgcCss = new HtmlGenericControl("link");
            hgcCss.Attributes.Add("href", Url);
            hgcCss.Attributes.Add("rel", "stylesheet");
            hgcCss.Attributes.Add("type", "text/css");
            TargetPage.Header.Controls.Add(hgcCss);
        }
//arabic button click event.
protected void Button1_Click(object sender, ImageClickEventArgs e)
  {
        IncludeCss("Arabic.css");

  }


在CSS中,有一个名为 direction 的属性来改变文本方向。

In CSS, there is property called direction to change text direction.
.gvEnglish
{
  direction:ltr;
}
.gvArabic
{
  direction:rtl;
}


为此,如果选择是arbic则需要两个gridview第二个打电话给第二个。
For this u will need two gridview if the selection is arbic then call first other wise second .


这篇关于如何将gridview的列方向从ltr更改为rtl的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆