I'm trying to automate the UltraComboEditor control in C#. Assuming cboViews is an instance of UltraComboEditor and Item is the text string to match, the following line successfully changes to the correct selection.
foreach (String key in new List<string>(cboViews.Items.Keys)){ if (cboViews.Items[key].DisplayText.Trim() == Item) { cboViews.SelectedItem = cboViews.Items[key]; return; }}
However, the AfterCloseUp event is not fired, which makes sense because the drop down menu is never shown. I must fire the AfterCloseUp event.
The following block of code inserted above, however, throws an ExecutionEngineException.
cboViews.DropDown(); *** Exception thrown herecboViews.SelectedItem = cboViews.Items[key]; cboViews.CloseUp();
My assumption, based on reading through the forums, is that DropDown is being called on the wrong object. I see an EditorWithCombo property, but it is protected and internal. Any insights are welcome.
Are you using any additional tools to test, or is this in a standard C# application? I just looked up the ExecutionEngineException type and apparently it should only be thrown in very rare cases by the CLR itself, not any applications, so I'm not really sure what could be causing that issue. Furthermore, I'm not sure how your code itself is working, since the ValueListItemsCollection class does not have any Keys property. Can you provide some more information about what you're doing and the exception you're getting? It would be more helpful if you could provide a small sample so that I could look into it.
-Matt