Esempio n. 1
0
        private void dtgAttributes_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            if (dgv.Columns[e.ColumnIndex].Name == "DeleteAttr")
            {
                UtilsFormsGrid.deleteFromgrid <ProjectAttribute>(dtgAttributes, e.RowIndex);
            }
        }
Esempio n. 2
0
        private void dtgClass_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            DataGridView dgv = sender as DataGridView;

            if (dgv.Columns[e.ColumnIndex].Name == "Attributes")
            {
                string className = dtgClass.Rows[e.RowIndex].Cells["ClassName"].Value?.ToString();
                grpAttr.Enabled = true;
                grpAttr.Text    = "Atributos da classe " + className;
                txtAttrName.Focus();
                _CurrenteClassName       = className;
                dtgAttributes.DataSource = new List <ProjectAttribute>();
                var currentProjectClass = _Project.ProjectClasses.FirstOrDefault(x => x.Name == _CurrenteClassName);
                if (currentProjectClass != null)
                {
                    dtgAttributes.DataSource = currentProjectClass.Attributes;
                }
            }
            else if (dgv.Columns[e.ColumnIndex].Name == "DeleteClass")
            {
                UtilsFormsGrid.deleteFromgrid <ProjectClass>(dtgClass, e.RowIndex);
                dtgClass.DataSource = new List <ProjectClass>();
            }
        }