Пример #1
0
        /*private void dgvListaCatPago_CellContentClick(object sender, DataGridViewCellEventArgs e)
         * {
         *
         * }*/

        private void btnNuevo_Click(object sender, EventArgs e)
        {
            ComunFilter.cp_id_contacto = 0;
            Contacto.frmNuevoContacto frm = new Contacto.frmNuevoContacto();
            if (frm.ShowDialog() == DialogResult.OK)
            {
                // 0 = Consulta Todos
                InitialLoad(0);
            }
        }
Пример #2
0
        //cambia color columna Estado

        /*private void dgvListaCatPago_CellFormatting(object sender, DataGridViewCellFormattingEventArgs e)
         * {
         *  DataGridView dgv = sender as DataGridView;
         *
         *  if (dgv.Columns[e.ColumnIndex].Name == "estadoDataGridViewTextBoxColumn")  //columna Esatado a evaluar
         *  {
         *      if (e.Value.ToString().Contains("Inactivo"))
         *      {
         *          e.CellStyle.ForeColor = Color.Red;
         *      }
         *      if (e.Value.ToString().Contains("Activo"))
         *      {
         *          e.CellStyle.ForeColor = Color.CornflowerBlue;
         *      }
         *  }
         * }*/

        private void dgvListaContacto_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (dgvListaContacto.Rows.Count > 0)
            {
                // Editar
                if (dgvListaContacto.CurrentCell.ColumnIndex == 7)
                {
                    ComunFilter.cp_id_contacto = Convert.ToInt32(dgvListaContacto.CurrentRow.Cells[0].Value.ToString()); // id_contacto

                    Contacto.frmNuevoContacto frm = new Contacto.frmNuevoContacto();
                    if (frm.ShowDialog() == DialogResult.OK)
                    {
                        // 0 = Consulta Todos
                        InitialLoad(0);
                    }
                }
            }
        }