How to average column values of several selected row of a dataGrid?
Posted on 2006-03-27
Consider a dataGrid with 3 columns of data...ID_Code, Product_A, Product_B. And for this example, there are 8 rows
of data. The items in the Product columns are quantities of products. Let's say the user wishes to select any
combination of 4 rows. Could you provide code examples of how to capture and average the values of Product_A and the
values of Product_B for the selected rows? In other words, What is the average value of Product_A for the 4 selected
rows and what is the average value of Product_B for the 4 selected rows?
I am using VB.Net and Access database. Thank you for your assistance.