Hi Fellow...
Used following guideline for performing Multiple or Add operations on DGV's individual cells to generate Auto-Calculated values for any other Cell in DGV
If you Really want to do programming by Heart...You can transform following steps into your Code Sytle...
Put following code into DGV's
CellValueChanged
Event.
if (e.RowIndex > -1)
{
if (DGV.Rows[e.RowIndex].Cells[1].FormattedValue.ToString() != "")
{
if (e.ColumnIndex == 1 || e.ColumnIndex == 2)
DGV.Rows[e.RowIndex].Cells[3].Value =
(decimal)(Cells[1].value) * (decimal)(Cells[2].value);
}
}
//Now to Calculate Sum of Each Column's Values...
//you can use following code snippet
<pre lang="cs">decimal total = 0;
for (int i = 0; i < rows; i++)
total += decimal)(DGV.Rows[i].Cells[3].Value);
</pre>
Note :- This is just Guideline and I know it's working I used it in my one of project. Here I just give a major points that you are looking for...
And The Code for Saving these DATA into database you should have to Try it by yourself.. I think you are very familiar with saving / retrieving data from Database.
Happy Programming...:-)