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 and crannies of VFP. :D

Thanks RK.

        && Decide if we need to change focus of the tab panel.
        DO CASE
                CASE RECCOUNT("csrSalesItem") > 0 AND RECCOUNT("csrSalesLabor") 
= 0
                        THISFORM.Pageframe1.Page1.SetFocus()
                        THISFORM.Pageframe1.Page1.grdSalesItem.Refresh()
                        THISFORM.Pageframe1.Page1.grdSalesItem.AutoFit()
                CASE RECCOUNT("csrSalesItem") = 0 AND RECCOUNT("csrSalesLabor") 
> 0
                        THISFORM.Pageframe1.Page2.SetFocus()
                        THISFORM.Pageframe1.Page2.grdLabor.Refresh()
                        THISFORM.Pageframe1.Page2.grdLabor.AutoFit()
                OTHERWISE
                        && Either both tabs have zero records, or both have 
records.
                        && If this is the case, then leave the tab panel focus 
how the user set it.

                        THISFORM.Pageframe1.Page1.grdSalesItem.Refresh()
                        lSuccess = 
THISFORM.Pageframe1.Page1.grdSalesItem.AutoFit()
                        THISFORM.Pageframe1.Page2.grdLabor.Refresh()
                        lSuccess = THISFORM.Pageframe1.Page2.grdLabor.AutoFit()
        ENDCASE



On 06/18/2015 11:32 AM, Richard Kaye wrote:
Have you tried refreshing the specific containers (i.e. the grid itself or the 
page or the pageframe)?

--

rk


_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: 
http://leafe.com/archives/byMID/profox/55830ae4.1060...@cullytechnologies.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to