We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Disposed Object KeyEnabledGrid

Thread ID:





82104 Jun 2,2009 08:56 AM UTC Feb 11,2010 03:37 AM UTC WinForms 3
Tags: Test Studio
Donni Delacruz
Asked On June 2, 2009 08:56 AM UTC


When I'm running my QTP script, whenever i close a window and open the same window again i encounter this error:

Cannot access a disposed object.
Object name: 'KeyEnabledGrid'.

This happens to most grids of class SwfObject when i do SetCurrentCell. Is there a way to handle this or to "un-dispose" the object once it is disposed?

Nirmal Raja [Syncfusion]
Replied On June 8, 2009 02:08 PM UTC


Thank you for your interest in Syncfusion products.

Please let me know on how you close and open the window through the script, and is the issue occurs on recording? If you see the issue in replay as soon as you close and open the window, then it is caused due to the delay on QTP in retriving the swfobject which has been recreated after disposed. So to avoid it, as a workaround, you can set a delay after opening the window by calling a method called 'wait 5', which will wait until the grid swfobject has been created and then you can go for the functionality of SetCurrentCell or any methods.
Please send us a sample or try to reproduce it in our shipped samples if you still face the issue.


Replied On February 9, 2010 10:16 AM UTC


I faced the same problem.

When i access the "HPSyncgrid" for the first time,It is working fine. When i try to repeat the same operation again(in For Loop),It is is throwing an error "Can not Access a disposed object : Objec name".

I dont think it is due to the wait time.

Can we do something witht the methods IsDisposed and ISDisposing.


Nirmal Raja [Syncfusion]
Replied On February 11, 2010 03:37 AM UTC

Hi Krishna,

Thank you for the update.

The control gets disposed when the application is closed, it will be created when it gets opened again, the QTP extensibility source don't have any chance of disposing the control object. It depends on the application on how it has been reinitiated. The IsDisposed method can be given in the source but it will skip the replay as the object has been disposed. Please let me know if you can send me a sample as we were unable to reproduce this issue, we can analyse the issue with your sample and get a solution.



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon