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 8589051
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T22:57:08+00:00 2026-06-11T22:57:08+00:00

I am writing a code where I need a GridView to display like as

  • 0

I am writing a code where I need a GridView to display like as below, what I can do is display columns and its values to fetched from database for the columns but unable to present the data in this format.

My procedure gets one value as Total from DB to be displayed as Amount 1 and do the calculations with that amount to fill in other Amount values and to display the difference between two values as A:B

Any ideas?

--------------------------------------------
Total Amount |                 |           |       
--------------------------------------------
Amount 1     |    Amount/12 A  |           |
-------------------------------------------
Amount 2     |    Amount/12 B  |  A:B      |
-------------------------------------------
Amount 3     |    Amount/12 C  |  A:C      |
-------------------------------------------
Amount ..10  |    Amount/12 D  |  A:D      |
-------------------------------------------
Total        |                 |           |
--------------------------------------------
  • 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-06-11T22:57:09+00:00Added an answer on June 11, 2026 at 10:57 pm

    Actually I can think of two ways to do this.

    Either you go the ugly unintuitive asp.net way and add a handler for the grid’s RowDataBound event. In that handler you would save the a value to a member variable if the member variable is empty. Else if the member variable is unemtpy you would do your calculation and add the difference as a new label in cell 3.

    The other way (which I’d like more) you would project your list (be that a datatable or other list) using linq into a new list of anonymous objects which has the properties of the original column plus a computed property for you extra column. Then you may databind the grid to your projected list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a very proficient C# developer, but need to start writing code that
I am writing some code in which i need to get a line from
I am writing java code where i need to get some information from a
When I am writing code in Python, I often need to remove items from
When writing server-side code you need to explicitly stop execution after sending a Location:
I'm writing code in Visual C++ and I need to use a global variable.
I'm writing the code for a controller method and I need to use it
I am writing some Ruby code, not Rails, and I need to handle something
I'm writing some terrible, terrible code, and I need a way to put a
For a piece of multiplatform c++ code I am writing, I need a shared

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.