private void mnuViewTailInfos_Click(object sender, EventArgs e) { if (this.dgvRealtimeCarInfos.DataSource != null && this.dgvRealtimeCarInfos.RowCount > 0 && this.dgvRealtimeCarInfos.SelectedRows.Count > 0) { DataGridViewRow drSelected = this.dgvRealtimeCarInfos.SelectedRows[0]; frmCarDetailInfos oFrmCarDetails = new frmCarDetailInfos (drSelected.Cells["carnumber"].Value.ToString(), drSelected.Cells["phone"].Value.ToString(), drSelected.Cells["x"].Value.ToString(), drSelected.Cells["y"].Value.ToString(), drSelected.Cells["direction"].Value.ToString()); oFrmCarDetails.ShowDialog(); } }