forum

Home / DeveloperSection / Forums / How to get the First Column Values of Selected Rows of DataGridView in C#?

How to get the First Column Values of Selected Rows of DataGridView in C#?

Anonymous User 9047 14-Nov-2013

I am using the below code to get the ID of columns :

DataGridViewSelectedCellCollection DGV =this.dgvSearch.SelectedCells;
for (int i = 0; i <= DGV.Count - 1; i++)
{
string ID = Convert.ToString(dgvSearch.CurrentRow.Cells[0].Value);
MessageBox.Show(ID);
}

I am getting the ID but I want it once foe each column.

How to do it?


c# c# 
Updated on 14-Nov-2013
I am a content writter !

Can you answer this question?


Answer

1 Answers

Liked By