Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
20
Automating UltraComboEditor
posted

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 here
cboViews.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.

 

Parents
No Data
Reply
  • 37774
    posted

    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

Children
No Data