private string GetSelectID(string FileName)
{
int[] pRows = this.gridView1.GetSelectedRows();//傳遞實體類過去 獲取選中的行
if (pRows.GetLength(0) > 0)
return gridView1.GetRowCellValue(pRows[0], FileName).ToString();
else
return null;
}
用的時候直接調用GetSelectID(列名)//列名是你想要獲取的列