You should add this into your code behind, and change the column index (at the minute it is set to 0) to correspond to the column header you want to change:
protected void gvw_Details_RowDataBound(object sender, GridViewRowEventArgs e)
{
// control flow - check e.Row.RowType is header
if (e.Row.RowType == DataControlRowType.Header)
{
e.Row.Cells[0].Text = "NAME";
}
}
Add in OnRowDataBound
to the aspx code:
<asp:GridView ID="gvw_Details" runat="server" OnRowDataBound="gvw_Details_RowDataBound" EmptyDataText="No Previous Enrollments were Found." SkinID="gridviewSkin2">
</asp:GridView>
Or alternatively, you can string concatenate the fields together in the SQL query itself and use the as
keyword instead. [as in the below answer]
Making use of the OnRowDataBound
event is a great way of modifying the presentation of data after binding to the datasource has taken place before rendering of the asp.net control.