deutschsprachige FoxPro User Group
Forum View
Home
  
  Re: Packing Data in a cDataForm- #14075 in section [742235]
Sec: (29) VFX english
Von: Uwe Habermann
An: David Phillips
Am/Um: 25.08.2019 15:06:24

--from Newsreader at Sonntag, 25. August 2019; 15:06:24--

Hi David!

>>I have created a number of file maintenance forms and added a command
>>button to pack the table.<<

Packing a table is an administrative task which should not be done by a
normal user nor in a maintenance form.

>>thisForm.PGFPAGEFRAME.Page1.grdGrid.RecordSource = ''<<

This restores the grid to its defaults, similar to set columncount = -1.

>>thisForm.PGFPAGEFRAME.Page1.grdGrid.RecordSource = 'Doctors'<<

At this moment still all of the previous settings of the grid are lost and
also all code in the methods of the columns and controls.

>>This allows me to successfully repopulate the grid but I have later
>>noticed that the columns in the form are now (after the pack) displaying
>>the incorrect field from the table. The columns in the grid are displaying
>>the data exactly as a browse would and not as the columns are set up in
>>the grid.<<

This is by design of VFP.

>>thisForm.PGFPAGEFRAME.Page1.GRDGRID.Column1.controlSource='Initials'<<

You can make all settings programmatically but you can't get back the code
this way. For example, you can't get back the incremental search feature.

>>Is there something I am missing that I should be doing when refreshing the
>>grid after a pack is issued.<<

There is nothing missing and everything is expected.

If you really want to pack within a form I suggest that you close the form
and reopen it afterwards.

Uwe Habermann




David Phillips   25.08.2019 09:03
Uwe Habermann  25.08.2019 15:06
  
zurück zum Forum