PxPlus User Forum

Twitter Twitter Twitter

Author Topic: Reference grid on panel (how to)  (Read 1283 times)

jdegrendele

  • Member
  • **
  • Posts: 16
    • View Profile
Reference grid on panel (how to)
« on: July 27, 2020, 05:55:04 PM »
Working with folders for the first time.  I have a base panel with 3 folders on it (header, detail, totals).  My details folder has a grid on it that I need to reference back to when the operator is done working on the invoice (for lack of a better term).  I'm using Preserve Controls and Auto Advance (thanks for that feature).  I'm trying to figure out the best way to get the information from the details grid once the user is done (since the user can pretty much click on any tab and/or the "I'm Finished" button).  Is there a way to reference a grid on a folder that is not in focus OR do I have to keep the grid data in a work file and read out of that.  I was trying to avoid the second option to cut down on updates back and forth between the grid and file.  Really hoping there's some way to say "hey, I need to get data out of that grid on folder 2 without having to switch focus back to the folder". 

Mike King

  • Diamond Member
  • *****
  • Posts: 3817
  • Mike King
    • View Profile
    • BBSysco Consulting
Re: Reference grid on panel (how to)
« Reply #1 on: July 28, 2020, 12:21:03 PM »
Jeff,

When using folder persistence, the controls on the folder get hidden and new CTL values assigned.  Technically you could still access the GRID control, but you would need to know what the new CTL value is.

In theory you should be able to find the new CTL value by taking the original CTL value and adding Fldr'theTab'StartIndex then multiplying that result by -1; where theTab is the tab the GRID was on. 

Frankly though I would simply add a GRID FIND 0,0,somevariable$ on the close of the folder with the grid to get all the values from all the cells and load these into an array.  It likely will be faster and easier to manage.
« Last Edit: July 28, 2020, 02:01:21 PM by Mike King »
Mike King
President - BBSysco Consulting
eMail: mike.king@bbsysco.com

jdegrendele

  • Member
  • **
  • Posts: 16
    • View Profile
Re: Reference grid on panel (how to)
« Reply #2 on: July 28, 2020, 04:53:36 PM »
The "On Exit" logic for the panel.  Perfect.  Again, just feeling my way thru the folder dynamic.  Do appreciate the other info regarding the Fldr properties as it's always nice to know what's going on in the background.  Thanks for the feedback.