Click here to Skip to main content
15,901,426 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a colums productquntity and total cost in gridview.

i want to multipy them and show them in another column having a label in template field.. how to do it pls give any coding example
Posted
Updated 4-Jan-12 11:33am
v2

Try this in DataGridView CurrentCellDirtyStateChanged Event

C#
private void DGViewIn_CurrentCellDirtyStateChanged(object sender, EventArgs e)
        {
            //Check if the Current Cell is Changed
            if (DGViewIn.IsCurrentCellDirty == true)
            {

DGView.CurrentRow.Cells[3].Value=int.Parse(DGView.CurrentRow.Cells[1].Value.ToString())*int.Parse(DGView.CurrentRow.Cells[2].Value.ToString());
DGView.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
}
 
Share this answer
 
v2
 
Share this answer
 
Comments
ProEnggSoft 30-Mar-12 6:04am    
Good link. 5!
Monjurul Habib 1-Apr-12 14:42pm    
thanks!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900