displaying subtotal in gridview footer

trying the code below to display footer row for subtotal of the column 'Amount'.

unfortunately couldnt.
css
---
.FooterStyle
{
    background-color: #E4E0EE;
    color: White;
    text-align: right;
}

aspx
----
<asp:GridView ID="gvClaimSummary"  HeaderStyle-BackColor="#B8A9DC"
                  AlternatingRowStyle-BackColor="#E4E0EE" HeaderStyle-ForeColor="White" 
                         BorderColor="Black" BorderWidth="1px" Width="1105px"
                         RowStyle-VerticalAlign="Top" AllowPaging="true" PageSize="10"
                  AutoGenerateColumns="false" runat="server"  
                          onrowdatabound="gvClaimSummary_RowDataBound" 
                        onpageindexchanging="gvClaimSummary_PageIndexChanging" 
                        onrowcommand="gvClaimSummary_RowCommand" onrowcreated="gvClaimSummary_RowCreated" 
                        >
                        <FooterStyle CssClass="FooterStyle" />

codebehind
----------
if (e.Row.RowType == DataControlRowType.DataRow)
        {
            
            
            Label _lblcatefield = (Label)e.Row.Cells[5].FindControl("lblCateField");
            Label _lblidfield = (Label)e.Row.Cells[5].FindControl("lblID3Field");

            if (_lblcatefield.Text == "multiple" && !String.IsNullOrEmpty(_lblidfield.Text))
            {
                //e.Row.Cells.RemoveAt(2);
                //e.Row.Cells.RemoveAt(3);
                //e.Row.Cells.RemoveAt(4);
                //e.Row.Cells[1].ColumnSpan = 4;

                e.Row.Cells.RemoveAt(2);
                e.Row.Cells.RemoveAt(2);
                e.Row.Cells.RemoveAt(2);
                e.Row.Cells[1].ColumnSpan = 4;


              
                List<UserClaimDetails> list_ucd = new List<UserClaimDetails>();
                list_ucd = UserClaimDetails.getUserClaimDetail_ucsummaryid(Convert.ToInt32(_lblidfield.Text));

                if (list_ucd.Count > 0)
                {
                    GridView _gv = (GridView)e.Row.FindControl("gvClaimSummaryMini");

                    if (_gv != null)
                    {
                        _gv.DataSource = list_ucd;
                        _gv.DataBind();
                    }

                    for (int i = 0; i < _gv.Rows.Count; i++)
                    {

                        Label _lblamount = (Label)_gv.Rows[i].Cells[3].FindControl("lblAmountField");

                        if (_lblamount.Text != String.Empty)
                        {
                            dgvminitotal += Convert.ToDecimal(_lblamount.Text);
                        }
                    }

                }
            }

        }
        else if (e.Row.RowType == DataControlRowType.Footer)
        {
            e.Row.Cells[2].Text = "SubTotal: ";
            e.Row.Cells[3].Text = dgvminitotal.ToString();
        }

Open in new window

LVL 1
doramail05Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AliSyedCommented:
what is the error you are getting?
Rajar AhmedConsultantCommented:
Total in footer . Easy to implement

http://aspalliance.com/782
doramail05Author Commented:
AliSyed :
nothing displayed on footer ,,

meeran03 :

i tried that artice, but does not give me the gridview footer row but only an additional amount on the right of each amount column.
Muhammad ZamanSoftware Development LeadCommented:
Hi,

Please set gridview property showfooter="true" , It will solve your problem

Cheers

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.