protected void StatusList_SelectedIndexChanged(object sender, EventArgs e) { ListViewFilterColumn fColumn = listSettings.FilterColumns.SingleOrDefault(fc => fc.ColumnName == "CurrentStatus"); if (StatusList.SelectedValue == "any") { if (fColumn != null) { listSettings.FilterColumns.Remove(fColumn); } } else { bool equality = (StatusList.SelectedValue != "open"); if (fColumn == null) { fColumn = new ListViewFilterColumn("CurrentStatus"); listSettings.FilterColumns.Add(fColumn); } fColumn.EqualityComparison = equality; fColumn.ColumnValue = (StatusList.SelectedValue == "open") ? "Closed" : StatusList.SelectedValue; } userSettings.Save(); OnSettingsChanged(); }
protected void AssignedStaffUserList_SelectedIndexChanged(object sender, EventArgs e) { ListViewFilterColumn fColumn = listSettings.FilterColumns.SingleOrDefault(fc => fc.ColumnName == "AssignedTo"); if (AssignedStaffUserList.SelectedValue == "anyone") { if (fColumn != null) { listSettings.FilterColumns.Remove(fColumn); } } else { if (fColumn == null) { fColumn = new ListViewFilterColumn("AssignedTo"); listSettings.FilterColumns.Add(fColumn); } if (AssignedStaffUserList.SelectedValue == "unassigned") { fColumn.EqualityComparison = null; fColumn.ColumnValue = null; } else { fColumn.EqualityComparison = true; fColumn.ColumnValue = AssignedStaffUserList.SelectedValue; } } userSettings.Save(); OnSettingsChanged(); }