private void refreshMainManagersCombo(string accountManager = "") { try { string newSelection = Globals.AllRecords; string currentSelection = (MainManagersCombo.SelectedItem != null)? MainManagersCombo.SelectedItem.ToString() : ""; List <string> managersList = ClientFunctions.CurrentManagersList(Globals.CurrentEntityID, true); if (currentSelection != "") { if (managersList.Contains(currentSelection) && (accountManager == "" || currentSelection == accountManager)) { newSelection = currentSelection; } // the previous AM is re-selected only if it matches the current Client record's AM MainManagersCombo.SelectedItem = newSelection; } MainManagersCombo.ItemsSource = managersList; MainManagersCombo.SelectedItem = newSelection; //refreshClientGrid(); // Not required as done by the automatic selection change } catch (Exception generalException) { MessageFunctions.Error("Error refreshing the list of current Account Managers", generalException); } }