private void dgvSP_CellMouseDoubleClick(object sender, DataGridViewCellMouseEventArgs e) { if (e.RowIndex > -1) { DbSPViewer v = new DbSPViewer(dgvSP.Rows[e.RowIndex].DataBoundItem as SOCommand); v.ShowDialog(); } }