我有在后面的代码中创建的网格。网格有描述、语言等列。问题是这 2 列的标题文本没有左对齐。网格内的数据左对齐。
我是否缺少任何东西来指定标题列文本的左对齐。
谢谢。
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();