Loop through rows in a grid

Can you show me a code sample for the array. I cannot figure it out.