how can i make a difference between column 3 and 2, and the result to be writen to column 4 ?
i tried with :
int n = dataGridView1.Rows.Add();
dataGridView1.Rows[n].Cells[3].Value = (int)dataGridView1.Rows[n].Cells[2].Value - (int)dataGridView1.Rows[n].Cells[1].Value;
but no result.

any idea?
ty

VulpesRank #55 · 29.2K reputationPosted Mar 11, 2012, 1:42 PM EDT
SenthilkumarRank #387 · 6.5K reputationPosted Mar 11, 2012, 8:44 PM EDT
If it it not then write the rowdatabound event.
You have include this in your grid. [OnRowDataBound="GridView1_RowDataBound"]
In the server side, you have to write the following event and code.
Hope this will help you...
Sam HobbsRank #107 · 20.5K reputationPosted Mar 12, 2012, 11:12 PM EDT
As best as I understand the question, this is for a Windows Forms DataGridView. Evidently Senthilkumar thought this is for an ASP.Net Gridview. The DataGridView has a RowsAdded event that could be used. The following is sample code for that.