Hi Friends,
I have a Gridview , that bind all the respective value(day, debit, credit, balance) from the table.
I just want to add a footer row that can have some of all debit & credit amount.
Gridview:Autogeneratecolumns is true;
so tell me what should be the approprite code to do it.
<asp:GridView ID="gdview" runat="server" CssClass="p"
style="top: -13px; left: 2px; position: relative; height: 964px; width: 703px"
AllowPaging="True" GridLines="None"
onpageindexchanged="gdview_PageIndexChanged"
onpageindexchanging="gdview_PageIndexChanging" ShowFooter="True"
Font-Names="Courier New" Font-Size="Small" PageSize="50"
onrowdatabound="gdview_RowDataBound">
<pagersettings pagebuttoncount="4" mode="NextPrevious" nextpagetext="Next">
PreviousPageText="Pre" />
<pagerstyle font-underline="True" forecolor="Black" horizontalalign="Justify" />
<columns>
<asp:TemplateField>
<footertemplate>
<asp:Label ID="lbl_fdebit" runat="server" Text='<%#"$"+Eval("Debit") %>'>
</footertemplate>
</columns></pagersettings>
private void binddata()
{
string st = "D";
con = new SqlConnection(constr);
cmd = new SqlCommand("SELECT datepart(" + st + ", date) as day1, CheckNO, Narration, COD, Debit, Credit, Balance FROM IOB_Stmt1 WHERE (Date between '" + Session["fordate"].ToString() + "' and '" + Session["todate"].ToString() + "')", con);
da = new SqlDataAdapter(cmd);
ds = new DataSet();
da.Fill(ds, "Emp");
gdview.DataSource = ds;
gdview.DataBind();
gdview.Visible = true;
DataTable dt = ds.Tables["Emp"];
Session["datatable"] = dt;
}