Beispiel #1
0
        public void cargarDatos()
        {
            logic = new GeneralLogic();

            dgv.CellContentClick   += new DataGridViewCellEventHandler(dgv_btnUpdate);
            dgv.AutoGenerateColumns = false;
            dgv.DataSource          = logic.ListaStudent();

            DataGridViewColumn column = new DataGridViewTextBoxColumn();

            column.DataPropertyName = "id";
            column.Name             = "ID";
            dgv.Columns.Add(column);

            DataGridViewColumn column2 = new DataGridViewTextBoxColumn();

            column2.DataPropertyName = "name";
            column2.Name             = "Nombre";
            dgv.Columns.Add(column2);

            DataGridViewTextBoxColumn column3 = new DataGridViewTextBoxColumn();

            column3.DataPropertyName = "lastname";
            column3.Name             = "Apellido";
            dgv.Columns.Add(column3);

            DataGridViewColumn column4 = new DataGridViewTextBoxColumn();

            column4.DataPropertyName = "phone";
            column4.Name             = "Celular";
            dgv.Columns.Add(column4);

            DataGridViewColumn column7 = new DataGridViewTextBoxColumn();

            column7.DataPropertyName = "phone";
            column7.Name             = "Celular";
            dgv.Columns.Add(column7);

            DataGridViewColumn column5 = new DataGridViewTextBoxColumn();

            column5.DataPropertyName = "createdAt";
            column5.Name             = "Fecha Registro";
            dgv.Columns.Add(column5);

            DataGridViewColumn column6 = new DataGridViewTextBoxColumn();

            column6.DataPropertyName = "updatedAt";
            column6.Name             = "Fecha Actualizacion";
            dgv.Columns.Add(column6);

            dgv.Columns.Add(CreateButton());
        }
Beispiel #2
0
 private void btnRefresh_Click(object sender, EventArgs e)
 {
     logic          = new GeneralLogic();
     dgv.DataSource = logic.ListaStudent();
 }