Пример #1
0
        private void dgvData_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                object Data = dgvData.Rows[e.RowIndex].DataBoundItem;
                if (Data != null && Data is Matricula)
                {
                    Matricula obj = (Matricula)Data;
                    if (obj != null)
                    {
                        switch (dgvData.Columns[e.ColumnIndex].Name)
                        {
                        case "clmEdit": FormOpen(new FrmMatriculaEdicao(obj, _objAluno, _objTurma)); break;

                        case "clmDelete":
                            if (Msg.Question("Deseja realmente excluir o registro??", "Excluir Registro"))
                            {
                                obj.Delete();
                            }
                            break;
                        }
                    }
                }
            }
        }