我得到 Must be nonnegative,index was out of range 错误,尽管所有单元格中都有数据并且索引也没有溢出
private void editToolStripMenuItem_Click(object sender, EventArgs e)
{
frmProfileMaster frm = new frmProfileMaster();
frm.status = "Edit";
frm.pid = Convert.ToInt32(gdvProfile.SelectedRows[0].Cells[0].Value);
frm.Show();
}