Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Cetin Basoz
  Where is Cetin Basoz?
 Izmir
 Turkey
 Cetin Basoz
 To: Ken Murphy
  Where is Ken Murphy?
 Springhill
 Canada
 Ken Murphy
 Tags
Subject: RE: grid returns header1,header1 as headers
Thread ID: 143342 Message ID: 143395 # Views: 1 # Ratings: 0
Version: Visual FoxPro 6 Category: Grids
Date: Tuesday, August 28, 2007 2:31:20 PM         
   


> > Solomon
> > Your grid propably looses source (recordsource)
> > Look code of save/activate, may be you close alias, used like grid recordsource or requery this by select sql.
> > If son , before this operation write
> >
> > This.grid1.recordsource =''
> > 

> > After you get alias again, set it to to grid
> >
> > This.grid1.recordsource ='myalias'
> > 

> > You can change header captions like this
> >
> > This.grid1.column1.header1.caption = 'what you need for caption'
> > 

> > ( make it for all columns)
> >
> >
> >
> > MVP , www.foxclub.ru domain owner
> > 100 friends are better than 100 dollars.
>
> Vladimir,
>
> Setting the .RecordSource to an empty string will work but only if your columns are in natural order. If you are putting field 3 in column 1 and Field 1 in column 4 (or what ever) you are going to run into problems here.
>
> Ken
> You shall know the truth - and the truth shall set you free. (John 8:33)

Not necessarily if your grid class is armed to handle order changes (and possibly user's preference on column widths, current sort etc). However it's tricky and not a trivial thing to achieve.
In my grids for example I don't know what a user's preference might be on the order of columns and such so I can't precreate a cursor with a known structure. Instead I simply specify an SQL and preferred columncount (visible columns), rest is handled by the class getting/setting user preferences. Vladimir's recordsource='' is exactly what I'm doing in between reloads of the data. It works wonderfully well for me.

Cetin Basoz

ENTIRE THREAD

grid returns header1,header1 as headers Posted by solomon sackey @ 8/28/2007 5:29:26 AM
RE: grid returns header1,header1 as headers Posted by Ken Murphy @ 8/28/2007 6:20:01 AM
RE: grid returns header1,header1 as headers Posted by Vladimir Zhuravlev @ 8/28/2007 6:26:19 AM
RE: grid returns header1,header1 as headers Posted by Ken Murphy @ 8/28/2007 6:29:30 AM
RE: grid returns header1,header1 as headers Posted by Cetin Basoz @ 8/28/2007 2:31:20 PM
RE: grid returns header1,header1 as headers Posted by Ken Murphy @ 8/28/2007 4:02:48 PM