I have grid that gets created in the code behind. Grid has columns like Description, Language. Issue is the headertext for these 2 columns is not getting left aligned. The data within the grid have left alignement.
Is there anything I am missing to specify left alignment for the header column text.
Thanks.
SPGridView gridView = new SPGridView();
gridView.AutoGenerateColumns = false;
// create the bound fields
SPBoundField boundField;
boundField = new SPBoundField();
boundField.HeaderText = "Description";
boundField.DataField = "Description";
boundField.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
boundField.ItemStyle.Wrap = false;
gridView.Columns.Add(boundField);
boundField = new SPBoundField();
boundField.HeaderText = "Language";
boundField.DataField = "Language";
boundField.ItemStyle.HorizontalAlign = HorizontalAlign.Left;
gridView.Columns.Add(boundField);
gridView.DataSource = dt.DefaultView;
gridView.DataBind();
您还必须设置页眉的对齐方式。
boundField.HeaderStyle.HorizontalAlign = System.Web.UI.WebControls.HorizontalAlign.Left;
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.