Last post Sep 16, 2014 05:47 AM by KosalaDilan
Jan 12, 2009 05:34 PM|ctbrewski|LINK
I have a css friendly grid view that defaults to text-align=left; for all columns. I have a few numerical columns that I would like to override text-align property to be right align. How do I do this?
Jan 12, 2009 09:46 PM|SGWellens|LINK
I've never used a CSS friendly grid view but this might work:
protected void GridView1_DataBound(object sender, EventArgs e)
GridView1.Columns.ItemStyle.HorizontalAlign = HorizontalAlign.Right;
May 28, 2010 10:11 AM|bhanumurthy24|LINK
I had the same issue. Thanks Wellens. Your suggestion solved my problem.
Sep 16, 2014 05:47 AM|KosalaDilan|LINK
protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
if (e.Row.RowType == DataControlRowType.DataRow)
e.Row.Cells.HorizontalAlign = HorizontalAlign.Center;