Re: Grid Autofit

2015-07-23 Thread mbsoftwaresolutions
I use a grid method I took from Paul Mrozowski 10 years ago called SaveSource and RestoreSource so you never have to hardcode like Rafael's example below. Check out the archives. I know I've posted it here in the past. It's basically this: this.pgf.pagData.grd.SaveSource()

RE: Grid Autofit

2015-06-18 Thread Richard Kaye
Have you tried refreshing the specific containers (i.e. the grid itself or the page or the pageframe)? -- rk -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Kevin Cully Sent: Thursday, June 18, 2015 11:16 AM To: profoxt...@leafe.com Subject: Grid

Grid Autofit

2015-06-18 Thread Kevin Cully
I'm working on a VFP form and I don't think I'm using a best practice for AUTOFITting a grid. I've a pageframe with two pages, each page has a grid. Many of these parent records have zero child sales records and/or labor records. What's the best practice to get the grids to AUTOFIT reliably?

RE: Grid Autofit

2015-06-18 Thread Kurt Wendt
. Anyway - it's just a thought... -K- -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Kevin Cully Sent: Thursday, June 18, 2015 11:16 AM To: profoxt...@leafe.com Subject: Grid Autofit I'm working on a VFP form and I don't think I'm using a best practice

Re: Grid Autofit

2015-06-18 Thread Thierry Nivelet
Hi Kevin, you no longer need to zap and append to your cursor; you can just: .RecordSource = '' used to be 'myCursor' select ... into cursor myCursor .RecordSource = 'myCursor' this might make .AutoFit() work better Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud

Re: Grid Autofit

2015-06-18 Thread Koen Piller
that you are not even capturing the return value. Anyway - it's just a thought... -K- -Original Message- From: ProfoxTech [mailto:profoxtech-boun...@leafe.com] On Behalf Of Kevin Cully Sent: Thursday, June 18, 2015 11:16 AM To: profoxt...@leafe.com Subject: Grid Autofit I'm

Re: Grid Autofit

2015-06-18 Thread Rafael Copquin
The best way to do this is thus: Populate the grid on page 1 with the father records. This grid will never loose its settings. In the afterrowcolchange method of this grid put the following code: (this code operates on each record of page 1 as you go up or down its grid)

Re: Grid Autofit

2015-06-18 Thread Kevin Cully
The AutoFit operation always returns .T. On 06/18/2015 11:29 AM, Kurt Wendt wrote: I saw in the Online help that it Returns a .T./.F. value based upon if it was successful. Have you tested the return value? In your code below - I see that you are not even capturing the return value.

Re: Grid Autofit

2015-06-18 Thread Kevin Cully
I think we have a winner here. I'm issuing a REFRESH() on each grid, right before calling the AUTOFIT() method. I think this forces VFP to display the latest data, and then the AUTOFIT can operate on the actual displayed data. Thus, it gets the sizing of the columns correctly. Ah the nooks