Hi indradeo,
Use the HeaderStyle-CssClass. Define a style to rotate the Header text and set in the HeaderStyle-CssClass.
CSS
<style type="text/css">
.VerticalColumn {
width: 80px;
height: 55px;
font: bold;
vertical-align: bottom;
-ms-transform: rotate(90deg);
-moz-transform: rotate(90deg);
-webkit-transform: rotate(90deg);
-o-transform: rotate(90deg);
transform: rotate(90deg);
filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
}
</style>
HTML
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" CssClass="auto-style11"
Height="138px" Width="87%" ShowFooter="true">
<Columns>
<asp:BoundField DataField="DEPARTMENT" HeaderText="DEPARTMENT" />
<asp:TemplateField HeaderText="Deviation">
<ItemTemplate>
<asp:LinkButton ID="Deviation" Text='<%# Eval("Deviation") %>' runat="server" CommandName="Deviation" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Near miss">
<ItemTemplate>
<asp:LinkButton ID="Near_miss" Text='<%# Eval("Near miss") %>' runat="server" CommandName="Near_miss" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="First Aid">
<ItemTemplate>
<asp:LinkButton ID="First_Aid" Text='<%# Eval("First Aid") %>' runat="server" CommandName="First_Aid" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fire">
<ItemTemplate>
<asp:LinkButton ID="Fire" Text='<%# Eval("Fire") %>' runat="server" CommandName="Fire" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Training">
<ItemTemplate>
<asp:LinkButton ID="Training" Text='<%# Eval("Training") %>' runat="server" CommandName="Training" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="TBT/Pep Talk">
<ItemTemplate>
<asp:LinkButton ID="TBT_Pep_Talk" Text='<%# Eval("TBT_Pep_Talk") %>' runat="server" CommandName="TBT_Pep_Talk" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Non-Reportable">
<ItemTemplate>
<asp:LinkButton ID="NonReportable" Text='<%# Eval("Non-Reportable") %>' runat="server" CommandName="NonReportable" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Reportable">
<ItemTemplate>
<asp:LinkButton ID="Reportable" Text='<%# Eval("Reportable") %>' runat="server" CommandName="Reportable" footertext="Grand Total:" footerstyle-font-bold="true" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Fatal">
<ItemTemplate>
<asp:LinkButton ID="Fatal" Text='<%# Eval("Fatal") %>' runat="server" CommandName="Fatal" showfooter="true" autogeneratecolumns="false" />
</ItemTemplate>
<FooterTemplate>
<div style="padding: 0 0 5px 0">
<asp:Label ID="lblPageTotal" runat="server" />
</div>
<asp:Label ID="lblTotal" runat="server" />
</FooterTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Total Count" HeaderStyle-CssClass="VerticalColumn">
<ItemTemplate>
<asp:Label ID="lblTotal" runat="server" Text='<%# Eval("Total Count") %>' />
</ItemTemplate>
<FooterTemplate>
<asp:Label ID="lblTotal" runat="server" />
</FooterTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Code
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] {
new DataColumn("DEPARTMENT"),
new DataColumn("Deviation"),
new DataColumn("Near miss"),
new DataColumn("First Aid"),
new DataColumn("Fire"),
new DataColumn("Training"),
new DataColumn("TBT_Pep_Talk"),
new DataColumn("Non-Reportable"),
new DataColumn("Reportable"),
new DataColumn("Fatal"),
new DataColumn("Total Count")
});
dt.Rows.Add("Ash Handling", "", "", "", "", "", "1", "", "", "", "1");
dt.Rows.Add("C & I Maintenance", "", "", "", "", "", "1", "1", "1", "1", "4");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}