datagrid population problem

larris

Member
Joined
Mar 13, 2006
Messages
23
Programming Experience
1-3
I have a datagrid with 4 columns.I populate the 2 colums with data from an access database.i need to populate the fourth collumn with calculated data from the 2 columns when i press a button.The grid is made in disigner and the 2 collums is databound the other one is unbound collumn
Here is the sample code i use to the "when button click" event:

dim row as datagridviewrow

For Each row In datagridview1.Rows
row.Cells("collumn4").Value = Math.Round(row.Cells("collumn1").Value / row.Cells("collumn2").Value, 2)
next

when i run the program then grid is populated correctly but when i press the button it raises the following message:
"Column named collumn4 cannot be found"
can someone help me please..
 
Back
Top