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
Sam HobbsPosted Mar 13, 2012, 3:12 AM
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.
{{}}SenthilkumarPosted Mar 12, 2012, 12:44 AM
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...
VulpesPosted Mar 11, 2012, 5:42 PM