Summarizing data with GridDataBind

This page is an enhancement to the Master Detail Sample.

Like the master/detail sample, this page displays the order details for each order. Additionally, summary data is displayed for both the Orders table and the Order Details table by handling the GridDataBind event. Note that these calculations do not require an extra query and roundtrip to the database, and are therefore a good method of quickly calculating aggregations over the current table.

- For the orders table, the total numer of orders is displayed.
- For the order details table, the total value of the order details is calculated and displayed.

Orders

Search:  

  OrderIDCustomerIDEmployeeIDShippedDateShipVia
EditDetails10643Alfreds FutterkisteMichael Suyama02Sep97Exotic Liquids
EditDetails10692Alfreds FutterkisteMargaret Peacock13Oct97New Orleans Cajun Delights
EditDetails10702Alfreds FutterkisteMargaret Peacock21Oct97Exotic Liquids
EditDetails10835Alfreds FutterkisteNancy Davolio21Jan98Grandma Kelly's Homestead
EditDetails10952Alfreds FutterkisteNancy Davolio24Mar98Exotic Liquids
EditDetails11011Alfreds FutterkisteJanet Leverling13Apr98Exotic Liquids
EditDetails10308Ana Trujillo Emparedados y heladosRobert King24Sep96Grandma Kelly's Homestead
EditDetails10625Ana Trujillo Emparedados y heladosJanet Leverling14Aug97Exotic Liquids
Page: 1 2 3 4 5 6 7 8 9 10 ... Next

   

Total number of orders displayed: 830

Order Details

 OrderIDProductUnitPriceQuantityDiscount
Edit10643Rössle Sauerkraut45.60150.25
Edit10643Chartreuse verte18.00210.25
Edit10643Spegesild12.0020.25
Page: 1

   

Total value of this order: 814.50