Loop through selected rows of gridcontrol c# devexpress

foreach (int i in dtData.GetSelectedRows())
{
    DataRow row = dtData.GetDataRow(i);
    deduction += Convert.ToDecimal(row["DeductionAmount"]);
}