R
Rajat Tandon
Hi,
I have a grid which is continuously updating by the data from a external
event. When I close the form on which the grid is placed, then it gives the
error message ...
"Can not access a disposed object".
I understand that it is because as soon as the form is closed it will in
turn try to dispose the grid. I have unwired the event in the dispose of
grid (In which event I get the data) but it doesn't solve the purpose
completely. It is because when the dispose is called for grid, control might
be inside the method (Though I have already check in the start of the method
if the instance of the grid is not null) , where the grid is accessed.
Please tell me, how I can avoid this situation and dispose the grid
properly.
Regards,
Rajat.
I have a grid which is continuously updating by the data from a external
event. When I close the form on which the grid is placed, then it gives the
error message ...
"Can not access a disposed object".
I understand that it is because as soon as the form is closed it will in
turn try to dispose the grid. I have unwired the event in the dispose of
grid (In which event I get the data) but it doesn't solve the purpose
completely. It is because when the dispose is called for grid, control might
be inside the method (Though I have already check in the start of the method
if the instance of the grid is not null) , where the grid is accessed.
Please tell me, how I can avoid this situation and dispose the grid
properly.
Regards,
Rajat.