Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSHARP

c# select a row from datagridview by value

String searchValue = "somestring";
int rowIndex = -1;
foreach(DataGridViewRow row in DataGridView1.Rows)
{
    if(row.Cells[1].Value.ToString().Equals(searchValue))
    {
        rowIndex = row.Index;
        break;
    }
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #select #row #datagridview
ADD COMMENT
Topic
Name
9+4 =