private void Form_Load(object sender, EventArgs e) { // Don't populate the control in design mode if (DesignMode) { return; } // basic settings tbAlertMonitorName.Text = _alertDefinition.Name; tbAlertDescription.Text = _alertDefinition.Description; cbEmailAlert.Checked = _alertDefinition.EmailAlert; // trigger settings selectedFields.AfterSelect += new AfterSelectEventHandler(selectedFields_AfterSelect); foreach (AlertTrigger trigger in _alertDefinition.Triggers) { AddTriggerToList(trigger); } // CMD 8.4.1 // select computers settings - note that we opt to display root level assets but not lower level as these // shgould only be populated as and when required selectLocationsControl.Populate(true, false, true); // get the ID of the asset first - selectLocationsControl.RestoreSelections requires an ID List <string> monitoredComputers = new List <string>(); AssetDAO lAssetDao = new AssetDAO(); foreach (string monitoredComputer in _alertDefinition.MonitoredComputers) { monitoredComputers.Add(lAssetDao.ConvertNameListToIds(monitoredComputer)); } if (_alertDefinition.MonitoredComputers.Count > 0) { selectLocationsControl.RestoreSelections("", Utility.ListToString(monitoredComputers, ',')); } }