Plex 2E

 View Only
  • 1.  Get total of selected cells in grid using meta data,

    Posted Feb 15, 2017 01:33 AM
      |   view attached

    Hi, 

    My requirement : I have a Grid (Gridp) witch has a few fields in it 3 of them is different mass fields.

    On my screen I also have one text box witch if possible I would like to populate with the selected mass field from the grid.

     

    In other words the user multi select one column (Depends on the one he selects the cells) and then it should sum the selected cells in the text box. So it should sum the selected cells in the text box.

     

    My Idea is to on the select event on the grid  use meta data to loop the gridp all the fields and get all the cells of the grid with "state"  "selected" ( the state it is when you select it) then if the sate is selected to sum it .Not sure if this will work. I am not that good with the syntax of meta data and need help or an example to loop a Gridp cells and check a specified "state" on the cell and if its selected to sum it In meta data.

     

    Attached is an example of  a screen that cells are selected and how it should sum.

     

    Using Plex 6.1 will be upgrading to latest release in a few months. The screen is  WINC.

     

    Thanks in advance.



  • 2.  Re: Get total of selected cells in grid using meta data,

    Posted Feb 15, 2017 03:02 PM

    this is way easier than you are making it.

     

    Seen this done just using the FOR EACH SELECTED

    Lighting quick, not even a screen flicker.



  • 3.  Re: Get total of selected cells in grid using meta data,

    Posted Feb 16, 2017 12:54 AM

    I did start using the FOR EACH SELECTED, but then how do you know witch Column to sum? the user can select any column( one of the mass columns)  and I need to sum it and display it in one text box on the screen? The problem is I don't know how what column the user clicked and selected. That  is why I thought of using meta data to get the selected column cells.

     

    So please can you give an example or guide me?



  • 4.  Re: Get total of selected cells in grid using meta data,

    Posted Feb 16, 2017 03:13 AM

    I would save yourself the hassle of using the http://wiki.plexinfo.net/index.php?title=WinWidgets to determine which column by simply having fixed columns with sum fields above the column headings and sum each column.

     

    What happens when the user selects two columns in your example..



  • 5.  Re: Get total of selected cells in grid using meta data,

    Posted Feb 16, 2017 03:28 AM

    you would need to use the following:HGM_SETSELEXTENT  HGM_GETSELEXTENT  HGM_GETSELANCHOR



  • 6.  Re: Get total of selected cells in grid using meta data,

    Posted Feb 16, 2017 03:37 AM

    and