i use these following codes to get cell’s value in datagridview.
these codes show me each cell has been clicked.
i want to use some codes just show me special column for example column with index 1 but these codes show me each which has been clicked. Imagine i just want to show column 1 with it’s clicked cell. please help me to solve this
string str = dataGridView1.CurrentCell.Value.ToString();
Thanks in advance
So you’re trying to get the data from the second column for every row?
Edit: Per your comment, you’re trying to get the value of the second column when any cell in the row is clicked. Try this: