Development #570

Merged
djankowski merged 40 commits from Development into master 2025-06-23 14:58:29 -04:00
Showing only changes of commit 3e53ec9191 - Show all commits

View File

@ -183,7 +183,7 @@ namespace Volian.Controls.Library
foreach (KeyValuePair<string, ComboBox> pair in _DicSingleRO)
{
string val = MyConfig.GetValue("EP", pair.Key);
if (val != null && val != "")
if (!string.IsNullOrEmpty(val) && pair.Value.Items.OfType<ROListItem>().Any(x=> x.Value == val))
pair.Value.SelectedValue = val;
else
pair.Value.SelectedValue = "";
@ -199,8 +199,8 @@ namespace Volian.Controls.Library
var selectedvalues = val.Split(multiseparator.ToCharArray());
foreach (string item in selectedvalues)
{
string text = ((List<ROListItem>)pair.Value.DataSource).First(x => x.Value == item).Text;
pair.Value.SetSelected(pair.Value.FindString(text), true);
string text = ((List<ROListItem>)pair.Value.DataSource).Find(x => x.Value == item)?.Text;
if (!string.IsNullOrEmpty(text)) pair.Value.SetSelected(pair.Value.FindString(text), true);
}
}