private void dataGridView_SelectionChanged(object sender, EventArgs e) { if (chkZoomToFeature.Checked == false) { return; } if (this.dataGridView.CurrentRow == null) { return; } int oid = Convert.ToInt32(this.dataGridView.CurrentRow.Cells[0].Value); if (oid <= -1) { return; } _mapView.ZoomToFeature(_featureLayer, oid); }