You can iterate through grid rows using the Rows collection of GridViewRowInfo objects. The example below selects the last row, then iterates looking for selected rows. When the selected row is found, the GridViewRowInfo EnsureVisible() method scrolls the row into view:
Copy[C#] Iterating RadGridView rows
GridViewRowInfo lastRow1 = radGridView1.Rows[radGridView1.Rows.Count - 1];
lastRow1.IsSelected = true;
foreach (GridViewRowInfo rowInfo in radGridView1.Rows)
{
if (rowInfo.IsSelected)
{
rowInfo.EnsureVisible();
}
}
Copy[VB.NET] Iterating RadGridView rows
Dim lastRow As GridViewRowInfo = RadGridView1.Rows(RadGridView1.Rows.Count - 1)
lastRow.IsSelected = True
For Each rowInfo As GridViewRowInfo In RadGridView1.Rows
If rowInfo.IsSelected Then
rowInfo.EnsureVisible()
End If
Next
Finding a grid row by a value of one of its cells
You could search for specific value in RadGridView by iterating through the rows and compare cells value. In the example below, you search for searchedStr in MyColumnName column:
Copy[C#] Find RadGridView row by cell value
string searchedStr = "Picture 2";
for (int r = 0; r < radGridView1.RowCount; r++)
{
if (radGridView1.Rows[r].Cells["Picture Name"].Value.ToString().ToUpper().Equals(searchedStr.ToUpper()))
{
MessageBox.Show("Found a match");
}
}
Copy[VB.NET] Find RadGridView row by cell value
Dim searchedStr As String = "Picture 2"
For row As Integer = 0 To RadGridView1.RowCount - 1
If RadGridView1.Rows(row).Cells("Picture Name").Value.ToString().ToUpper().Equals(searchedStr.ToUpper()) Then
MessageBox.Show("Found a match")
End If
Next