I have a gridview and bind to dataset for showing price in one column , price should seprated by "," and currency symbol at the end.
protected void gvAirWaybill_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
double a = Convert.ToDouble(e.Row.Cells[11].Text.Trim());
e.Row.Cells[11].Text = (a.ToString("C0", CultureInfo.CreateSpecificCulture("fa-IR")));
}
}
but it writes the symbol then price.how to set direction left to right just for this in runtime?
尝试设置样式属性
e.Row.Cells[11].Style.Add("dir", "rtl");
If you want to set all the gridview as right to left, you can declare your gridview like this:
<asp:GridView ID="gvAirWaybill" runat="server" dir="rtl" >
...
</asp:GridView>
You can create a CSS class
.dir-rtl{
direction:rtl;
}
Then in the grid markup set the Column's Item Style CssClass to that CSS class that you created
<ItemStyle CssClass="dir-rtl" />
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.