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
15
Programmatically Click UltraGrid Button
posted

I am writing a unit test and need to programmatically click a button in an UltraGrid I've created. I cannot seem to find a method to do this. For a standard Windows control there is a PerformClick() method but I can't find the equivalent for the button in my UltraGrid. I am using a MVP design so my presenter subscribes to the ClickCellButton event so I'd like to programmatically click the cell button for a given row and trigger the code in my presenter. Thanks!

Parents
  • 28945
    Offline posted

    Hello Thomas, 

    Thank you for contacting Infragistics. Please clarify that you want to call PerformClick in a test, not in a live application the user is working with?

    How are you adding buttons to your grid cells? If they are embedded UltraButtons or Microsoft Buttons they both should expose a PerformClick that you should be able to fire directly. The grid does not expose this method if the column's ColumnStyle property is set to Button since these are not controls.

    If the application is finished and your testing it, you might want to consider using our Test Advantage software, as it records and plays back clicks for you automatically; better suited for a job that needs to mimic user input. 

    Let me know if you have any questions.

Reply Children