Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4090602
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:15:33+00:00 2026-05-20T19:15:33+00:00

I have a Gridview like this; In my .cs file i calculate value of

  • 0

I have a Gridview like this;

enter image description here

In my .cs file i calculate value of BV, MV, KV total value with this code and i assign to a Label. Labels are under the Gridview. BUT, some customer names long some of short, because of that, labels location changing according to Gridview. Because of that i don’t want use Label.

I calculate a value with this code, and how can i assing BV, MV and KV columns footer this value?

double sumRISK = 0;
            foreach (GridViewRow gvr in GridView1.Rows)
            {
                CheckBox cb = (CheckBox)gvr.FindControl("NameCheckBoxField1");
                if (cb.Checked == true)
                {
                    double amountBV = Convert.ToDouble(gvr.Cells[7].Text);
                    if (amountBV != -1)
                    {
                        sumRISK += amountBV;
                    }
                }
            }
            RISK_Label.Text = String.Format("{0:n}", sumRISK);
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T19:15:34+00:00Added an answer on May 20, 2026 at 7:15 pm

    You should be able to set the FooterRow like below

    GridView1.FooterRow.Cells[0].Text = SumRISK.ToString();
    

    Here is a small working example using the same way of summarizing as you.

            int[] values = {1,3,6};
    
            GridView1.DataSource = values;
            GridView1.DataBind();
    
            int total = 0;
    
            foreach (GridViewRow item in GridView1.Rows)
            {
                total += Convert.ToInt32(item.Cells[0].Text);
            }
    
            GridView1.FooterRow.Cells[0].Text = total.ToString();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have Gridview like this. Here is my last column Gridview code; <EditItemTemplate> <asp:TextBox
hi I have this gridview like this. <asp:DropDownList ID=triggerDropDown runat=server AutoPostBack=true onselectedindexchanged=triggerDropDown_SelectedIndexChanged> <asp:GridView ID=myGridView
I have a GridView like this( main.xml ): <?xml version=1.0 encoding=utf-8?> <GridView xmlns:android=http://schemas.android.com/apk/res/android android:id=@+id/gridView1
I have a GridView what I fill through a LINQ expression. Something like this:
I have my <asp:GridView ID=gridView runat=server> I bind it like this : myConnection.Open(); SqlCommand
i have searched Xcode controls but doesn't found anything that makes a GridView like
I have a GridView which is like: File Name DateTimeUploaded Type Resume 1/13/2012 7:52:59
I have a gridview which is like <asp:TemplateField HeaderText=File Name SortExpression=FileName> <ItemTemplate> <asp:LinkButton ID=lnkname
I have gridview in my asp.net 3.5 application [C#]. Which looks like this: <asp:GridView
i have a gridview table like this... <div> <asp:GridView ID=GridView1 runat=server AllowSorting=true OnSorting=TaskGridView_Sorting >

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.