//Boton Agregar / Modificar
        private void btnAgregar_Click(object sender, EventArgs e)
        {
            string rpta = "";

            if (ValidarCampos())
            {
                switch (btnAgregar.Text.Replace("&", ""))
                {
                case "Agregar":
                    rpta = NItemComprobacion.Insertar(txtMetodo.Text,
                                                      txtUnidad.Text,
                                                      Funciones.ConvertStringToDouble(txtRango.Text),
                                                      Funciones.ConvertStringToDouble(txtResolucion.Text),
                                                      Funciones.ConvertStringToDouble(txtCriterio.Text));
                    break;

                case "Actualizar":
                    rpta = NItemComprobacion.Actualizar(Convert.ToInt32(txtItem.Text),
                                                        txtMetodo.Text,
                                                        txtUnidad.Text,
                                                        Funciones.ConvertStringToDouble(txtRango.Text),
                                                        Funciones.ConvertStringToDouble(txtResolucion.Text),
                                                        Funciones.ConvertStringToDouble(txtCriterio.Text));
                    break;
                }

                if (rpta.Equals("OK"))
                {
                    if (btnAgregar.Text.Replace("&", "") == "Agregar")
                    {
                        this.MensajeOk("Se Insertó de forma correcta el registro");
                        Listar();
                        Limpiar();
                        dataItems.Rows[(dataItems.RowCount - 1)].Selected = true;
                        dataItems.FirstDisplayedScrollingRowIndex         = dataItems.RowCount - 1;
                        CargarCampos(dataItems.RowCount - 1);
                        //DataGridViewCellEventArgs arg = new DataGridViewCellEventArgs(3, 3);
                        //this.dataItems_CellClick(this.dataItems, arg);
                    }
                    else
                    {
                        this.MensajeOk("Se Actualizó de forma correcta el registro");
                        int nRow = dataItems.CurrentRow.Index;
                        Listar();
                        dataItems.Rows[nRow].Selected = true;
                        //this.dataItems.CurrentCell = this.dataItems[1, (dataItems.Rows.Count - 1)];

                        //dataItems.Rows[(dataItems.Rows.Count - 1)].Selected = true;
                        //dataItems.Rows.OfType<DataGridViewRow>().Last().Selected = true;
                    }
                }
                else
                {
                    this.MensajeError(rpta);
                }
            }
        }