Click here to Skip to main content
15,889,867 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want get value of the cell that clicked
Posted

1 solution

1. use the CellClick event to get the value of the clicked cell:
Data grid view selected cell value how to get it[^]
2. To convert the value to integer, use Int32.TryParse Method[^]
 
Share this answer
 
Comments
Star Hostani 7-Feb-15 5:24am    
i want to get the value of the cells that user clicked
for (int i = 0; i < 1000; i++)
{
int num = Convert.ToInt32(dataGridView1.Rows[i].Cells[4].Value);
MessageBox.Show(num.ToString());

}
i wrote that code but actually it is not the same thing that i want because i want to get it and then use it in another place
Peter Leow 7-Feb-15 5:56am    
Visit the links and learn.

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