private void cmbAttitudine_SelectedValueChanged(object sender, EventArgs e) { if (cmbAttitudine.SelectedValue != null) { string cdAttitudine = cmbAttitudine.SelectedValue.ToString(); using (context = CreateDatabaseContext()) { AbilitaManager skillmanager = new AbilitaManager(context); grdAbilita.DataSource = skillmanager.GetSkillsFromGroup(cdAttitudine); } } }
private void LoadSkillGrid() { if (grdListe.SelectedRows.Count == 1) { string cdAttitudine = grdListe.SelectedRows[0].Cells["CdAttitudine"].Value.ToString(); using (databaseContext = CreateDatabaseContext()) { AbilitaManager manager = new AbilitaManager(databaseContext); var abilita = manager.GetSkillsFromGroup(cdAttitudine); grdAbilita.DataSource = abilita; } } else { grdAbilita.DataSource = null; } }