//for sections protected void chkCtrlSection_CheckedChanged(object sender, EventArgs e) { foreach (GridViewRow row in grid_Section.Rows) { CheckBox ck = ((CheckBox)row.FindControl("chkCtrlSection")); Section _sec = new Section(); _sec.SectionID = Convert.ToInt16(row.Cells[1].Text); _sec.SectionName = row.Cells[2].Text; if (ck.Checked) { if (SelectedSections.Where(sec => sec.SectionID == _sec.SectionID).Count() == 0) { SelectedSections.Add(_sec); } } else { if (SelectedSections.Where(sec => sec.SectionID == _sec.SectionID).Count() > 0) { var _section = SelectedSections.Where(sec => sec.SectionID == _sec.SectionID).First(); SelectedSections.Remove(_section); } } } }
private void OnNotSelectedSectionDoubleClickCommand() { var section = SelectedNotSelectedSection; if (section == null) { return; } NotSelectedSections.Remove(section); SelectedSections.Add(section); RaisePropertyChanged(() => SelectedSections); RaisePropertyChanged(() => NotSelectedSections); }