Using UI automation from Coded Ui does not receive updates of the layout


I am using coded ui test and testing an UltraGrid using UiAutomation.

Everything works fine but when I go to my application and change the columns visible on the screen and I execute again my tests, the Ui Automation Element is not updated and still contains the headers of the first run.

I tried everything up to now.

The only way to update the ui automation elements is to restart the application.

I also checked inside the application code but from that side the variables seems to be updated correctly.