私は次のことを試みていましたが、ヘッダー行が null と表示されますか?>
private void CreateGridControl()
{
lastCreatedOpportunitiesGrid = new GridView();
BoundField bOportunityCode = new BoundField();
bOportunityCode.DataField = "OpportunityCode";
bOportunityCode.HeaderText = "OpportunityCode";
lastCreatedOpportunitiesGrid.Columns.Add(bOportunityCode);
BoundField bOpportunityName = new BoundField();
bOpportunityName.DataField = "OpportunityName";
bOpportunityName.HeaderText = "OpportunityName";
lastCreatedOpportunitiesGrid.Columns.Add(bOpportunityName);
HyperLinkField bCSLink = new HyperLinkField();
bCSLink.DataNavigateUrlFields = new string[] {"CsLink"};
bCSLink.HeaderText = "CsLink";
bCSLink.Text = @"<img src='" + ResolveUrl("/_layouts/15/xx/xx/Images/cs.gif") + "' /> ";
lastCreatedOpportunitiesGrid.Columns.Add(bCSLink);
lastCreatedOpportunitiesGrid.HeaderRow.CssClass = Constants.CssClasses.HeaderRow;
lastCreatedOpportunitiesGrid.RowStyle.CssClass = Constants.CssClasses.Row;
lastCreatedOpportunitiesGrid.AutoGenerateColumns = false;
lastCreatedOpportunitiesGrid.EmptyDataText = Constants.Messages.NoOpportunitiesFound;
this.Controls.Add(lastCreatedOpportunitiesGrid);
LoadGridData();
}