Plex 2E

Expand all | Collapse all

Get Grid column names from code

  • 1.  Get Grid column names from code

    Posted 05-08-2019 03:13 AM

    Hi guys, I'm a newbie on Plex

     

    Is there a way to get the grid column header text from code ?



  • 2.  RE: Get Grid column names from code

    Posted 06-03-2019 04:18 PM
    Is there a reason you cannot use meta code, but have to read the grid properties?  I have used the following:
    +++define +field
    +++define +meta
    +for each field gridp
         +++set value to current +field
         +for defined property target FLD name NME
              +++set value to current +meta
              ++name defined +meta, Work<Column Heading>

    If you have to use source code at runtime, it appears possible.  If we had the WinWidgets help file it would be simpler.  I see from http://www.metadata.es/foros/viewtopic.php?t=636 that we can send the grid the HGFM_GETNAME windows message.  It looks like they put the column number in m, and then if the column is not hidden, they get the name into str.  (they have a maximum of 100.  To be safe it would be better to send the HGFM_GETNAMELEN message, and get the name length.  I can see that the message is defined in the WIDGETS.H file of the Include directory (normally C:\program files (x86)\CA\Plex\7.2.1\Include ), but I do not know the format of the message.

    WORD wState = SendMessage(hwndGrid,HGFM_GETSTATE,m,0L);
    if(wState != 5) //If state is not hidden
    {
    char* str = new char[100];
    if((int)SendMessage(hwndGrid,HGFM_GETNAME,m,(LPARAM)str)) //Get the name of the Column
    {
    str1 = CString(str);
    if(text.GetLength() > 0)
    text += "\t"+str1; //Append the column name to the exisiting set with tab as delimiter
    else
    text = str1;
    }
    else
    break;
    delete str; //delete the memory allocated before.
    }
    }


  • 3.  RE: Get Grid column names from code

    Posted 06-04-2019 07:56 AM
    it is in  stellatools






  • 4.  RE: Get Grid column names from code

    Posted 06-04-2019 07:56 AM
    Edited by George Jeffcock 06-04-2019 08:28 AM
    re-post