Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Sithu Kyaw
  Where is Sithu Kyaw?
 Yangon
 Myanmar
 Sithu Kyaw
 To: David Mustakim
  Where is David Mustakim?
 Jakarta
 Indonesia
 David Mustakim
 Tags
Subject: RE: Grid blank when reload the same form
Thread ID: 365756 Message ID: 365776 # Views: 30 # Ratings: 0
Version: Visual FoxPro 9 Category: Grids
Date: Monday, December 31, 2012 11:52:23 AM         
   


> I am confused with your saying that your form.destroy (or grid1.destry) is programmed to release the grid's cursor/recordsource. If you just let the "autoopentables/autoclosetables" of the Data Enviroment's properties set to true then you should not need to release it manually. If you don't use DE but SPT instead then killing/releasing cursors should be even more straihtforward. In any case form only got destroyed when really released, not just hidden, and with that calling it again in anyway from anywhere - menu or whatever - would restore its initial settings of everything per design. If the grid goes blank while there is an error that relates to "dynamicbackcolor (setall)" then that should be corrected/resolved first but it has nothing to do at all with whatever you do on form.destroy
>
> David
> ..
> .
>
>
>
> >
> >
> > I use Default Data Session.
> > Grid.Init() has the code adding the columns and THIS.RecordSource = ''
> > Form.Init() sets the record source to the grid.
> >
> > I tried THIS.RecordSource = '' in Form.Init() as Tariq's suggest, but no success.


As I mentioned in my question, when I remove USE IN SELECT(Form.Grid.RecordSource) from Form.Destroy(), the problem resolved. That's why I'm curious to know.
The cursor should be closed/destroyed when the form or grid is destroyed, otherwise I think it is still open when I open the other forms and it will affect them.
The default values of "autoopentables/autoclosetables" are .T. in Data Environment, but I don't use Data Environment.
What is "SPT" you mean?

The problem only exists when I open the current form again and again from the menu.
I would not use private data session because of some reasons.

With Regards,
profile for Sithu on Stack Exchange, a network of free, community-driven Q&A sites

ENTIRE THREAD

Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 8:26:49 AM
RE: Grid blank when reload the same form Posted by Tariq Mehmood @ 12/31/2012 8:52:30 AM
RE: Grid blank when reload the same form Posted by Samir H. @ 12/31/2012 9:44:41 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 10:02:51 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 11:21:47 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 11:52:23 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 12:00:48 PM
RE: Grid blank when reload the same form Posted by tushar @ 12/31/2012 11:30:41 AM
RE: Grid blank when reload the same form Posted by David Mustakim @ 12/31/2012 11:38:01 AM
RE: Grid blank when reload the same form Posted by Sithu Kyaw @ 12/31/2012 10:02:52 AM