Hi smile,
Check the below sample.
HTML
<asp:GridView ID="GridView1" runat="server" AllowPaging="false" ShowFooter="true" AutoGenerateColumns="false"
Style="width: 100%; border-collapse: collapse;">
<Columns>
<asp:TemplateField>
<HeaderTemplate>
<asp:CheckBox ID="checkAll" runat="server" />
</HeaderTemplate>
<ItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Code">
<ItemTemplate>
<asp:Label ID="lbl_No" runat="server" Text='<%# Eval("GFID") %>' Width="50"></asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:BoundField ItemStyle-Width="150px" DataField="Year" HeaderText="Year" />
<asp:BoundField ItemStyle-Width="150px" DataField="Month" HeaderText="Month" />
<asp:BoundField ItemStyle-Width="150px" DataField="IssueDate" HeaderText="Issue Date" />
<asp:BoundField ItemStyle-Width="150px" DataField="DueDate" HeaderText="Due Date" />
<asp:BoundField DataField="AdmissionNo" HeaderText="Reg No">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ClassName" HeaderText="Class">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="SectionName" HeaderText="Section">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="Head" HeaderText="Monthly Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="AdmFees" HeaderText="Admission Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="TutionFees" HeaderText="Tution Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="LibFees" HeaderText="Library Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ExamFees" HeaderText="Exam Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="SportsFees" HeaderText="Sports Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="AnnualFees" HeaderText="Annual Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ProspectusFees" HeaderText="Prospectus Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="UniformFees" HeaderText="Uniform Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="BookFees" HeaderText="Book Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="TokenFees" HeaderText="Token Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="IDCardFees" HeaderText="ID Card Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="BusCardFees" HeaderText="Bus Card Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="ElecFees" HeaderText="Electricity Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="SchoolFund" HeaderText="School Fund">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="FunFees" HeaderText="Fun Fair Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="CSFees" HeaderText="Computer Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="GeneratorFees" HeaderText="Generator Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="SecFees" HeaderText="Security Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="TourFees" HeaderText="Tour Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="Others" HeaderText="Others Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
<asp:BoundField DataField="TotalFees" HeaderText="Total Fees">
<HeaderStyle HorizontalAlign="Left" Width="100%" Wrap="false" />
<ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="100%" Wrap="false" />
</asp:BoundField>
</Columns>
</asp:GridView>
C#
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.AddRange(new DataColumn[] {
new DataColumn("GFID"),
new DataColumn("Year"),
new DataColumn("Month"),
new DataColumn("IssueDate"),
new DataColumn("DueDate"),
new DataColumn("AdmissionNo"),
new DataColumn("ClassName"),
new DataColumn("SectionName"),
new DataColumn("Head"),
new DataColumn("AdmFees"),
new DataColumn("TutionFees"),
new DataColumn("LibFees"),
new DataColumn("ExamFees"),
new DataColumn("SportsFees"),
new DataColumn("AnnualFees"),
new DataColumn("ProspectusFees"),
new DataColumn("UniformFees"),
new DataColumn("BookFees"),
new DataColumn("TokenFees"),
new DataColumn("IDCardFees"),
new DataColumn("BusCardFees"),
new DataColumn("ElecFees"),
new DataColumn("SchoolFund"),
new DataColumn("FunFees"),
new DataColumn("CSFees"),
new DataColumn("GeneratorFees"),
new DataColumn("SecFees"),
new DataColumn("TourFees"),
new DataColumn("Others"),
new DataColumn("TotalFees")
});
dt.Rows.Add("663", "2018", "7-Jul", "02.08.2018", "07.08.2018", "R-000002", "Play group", "A", "500", "0", "0", "0", "0", "0", "0", "0", "0", "0", "0");
GridView1.DataSource = dt;
GridView1.DataBind();
}
}