I added several methods and properties that make the implementation of the code is more general than previous routines Dynamic_Grid one.
I hope you find it useful.
Best regards,
Claudio Soto
Code: Select all
// DESCRIPTION
*******************************************************************************
* DYNAMIC_GRID_2.PRG
* Modification of a GRID control at runtime:
* # INSERT different types of COLUMNS (NUMERIC,CHARACTER,DATEPICKER,COMBOBOX,SPINNER,CHECKBOX, etc.)
* # DELETE and MOVE columns and rows
* # CHANGE specific COLUMN CONTROL.
* # INSERT background IMAGE in Grid
*******************************************************************************
// #include: GRID_CONTROLS_EX.prg
**********************************************************************************
* GRID_ColumnCount ---> Return the Number of Column on GRID
*
* GRID_AddColumnEx ---> Complement of Method: AddColumn (nColIndex)
* GRID_DeleteColumnEx ---> Complement of Method: DeleteColumn (nColIndex)
*
* GRID_GetColumnControlsEx ---> Return Array with Controls of Column(nColIndex) ==> {cCAPTION, nWIDTH, nJUSTIFY, aCOLUMNCONTROL, bDYNAMICBACKCOLOR, bDYNAMICFORECOLOR, bCOLUMNWHEN, bCOLUMNVALID, bONHEADCLICK}
*
* GRID_GetColumnControl ---> Return specific Control of Column(nColIndex) ==> [cCAPTION, nWIDTH, nJUSTIFY, aCOLUMNCONTROL, bDYNAMICBACKCOLOR, bDYNAMICFORECOLOR, bCOLUMNWHEN, bCOLUMNVALID, bONHEADCLICK]
* GRID_SetColumnControl ---> Set specific Control of Column(nColIndex) ==> [cCAPTION, nWIDTH, nJUSTIFY, aCOLUMNCONTROL, bDYNAMICBACKCOLOR, bDYNAMICFORECOLOR, bCOLUMNWHEN, bCOLUMNVALID, bONHEADCLICK]
*
* GRID_GetColumnDisplayPos ---> Get the position of Column(nColIndex) in that display in the GRID
* GRID_SetColumnDisplayPos ---> Set the position of Column(nColIndex) in that display in the GRID
*
* GRID_GetColumnWidthDisplay -> Get the Width of Column(nColIndex) in that display in the GRID
*
* GRID_SetBkImage ---> Set background image in Grid
**********************************************************************************
// #include: ARRAY_FUNC.prg
*******************************************************************************
* ARRAY_CHANGE (nAction, aData, nIndex, [nPos | DataAdd]) --> Move/Add/Remove: COLUMN or ROW in Array
* ARRAY_GRID (cControlName, cParentForm, nAction, aGridData) --> Get/Add: data in GRID
*******************************************************************************