From c0edd4c587d96a49bfcf73d47ed13ad92e89965a Mon Sep 17 00:00:00 2001 From: Gabor Apati-Nagy Date: Wed, 28 Jun 2017 13:36:32 +0100 Subject: [PATCH] CA-224724: VBD edit page: show 'position in use' message on the dropdown items requested changed by code review Signed-off-by: Gabor Apati-Nagy --- XenAdmin/SettingsPanels/VBDEditPage.cs | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/XenAdmin/SettingsPanels/VBDEditPage.cs b/XenAdmin/SettingsPanels/VBDEditPage.cs index 10a9e8d9a..e32444a55 100644 --- a/XenAdmin/SettingsPanels/VBDEditPage.cs +++ b/XenAdmin/SettingsPanels/VBDEditPage.cs @@ -158,23 +158,15 @@ namespace XenAdmin.SettingsPanels if (comboBoxItemWithVdi != null) { devicePositionComboBox.Items.Add(comboBoxItemWithVdi); + + if (vbd != null && comboBoxItemWithVdi.VBD.userdevice == vbd.userdevice) + devicePositionComboBox.SelectedItem = comboBoxItemWithVdi; } else { devicePositionComboBox.Items.Add(new DevicePositionComboBoxItem(devicePosition)); } } - - // Make sure the userdevice for the selected VBD is the one selected in the combobox - foreach (DevicePositionComboBoxItem item in devicePositionComboBox.Items) - { - if (item.VBD != null && item.VBD.userdevice == vbd.userdevice) - { - devicePositionComboBox.SelectedItem = item; - - break; - } - } } finally {