DataGrid Column Labels
Bob Sneidar
bobsneidar at iotecdigital.com
Thu Apr 19 10:36:37 EDT 2018
Ah. My problem was that my datagrids had different objects when I checked. Probably because I have been working with this project since the v6 days.
BTW I replaced my datagrids which were showing non-3D column labels with fresh ones and they look fine now. I have 2 scripts that help me with this. They do not account for custom properties though. I need to update them to account for that:
on saveDatagrid pDataGrid
if pDatagrid is empty then
put the short name of the selectedObject into pDataGrid
end if
if not there is a group pDataGrid then
put "Invalid arguement. pDataGrid must be the name of a datagrid in the current stack." into mmsg
answer info mmsg as sheet
exit saveDatagrid
end if
put the short name of group pDataGrid into aSavedDataGrids [pDataGrid]["name"]
put the height of group pDataGrid into aSavedDataGrids [pDataGrid]["height"]
put the width of group pDataGrid into aSavedDataGrids [pDataGrid]["width"]
put the loc of group pDataGrid into aSavedDataGrids [pDataGrid]["loc"]
put the script of group pDataGrid into aSavedDataGrids [pDataGrid]["script"]
put the dgprop ["columns"] of group pDataGrid into aSavedDataGrids [pDataGrid]["columns"]
put the dgprop ["column labels"] of group pDataGrid into aSavedDataGrids [pDataGrid]["column labels"]
put the dgprop ["column widths"] of group pDataGrid into aSavedDataGrids [pDataGrid]["column widths"]
put the dgprop ["allow editing"] of group pDataGrid into aSavedDataGrids [pDataGrid]["allow editing"]
put the dgProp ["multiple lines"] of group pDataGrid into aSavedDataGrids [pDataGrid]["multiple lines"]
put getParentStack(the long id of group pDataGrid) into tThisStack
set the pSavedDataGrids of tThisStack to aSavedDataGrids
end saveDatagrid
on restoreDataGrid pDataGrid
put getParentStack(the long id of group pDataGrid) into tThisStack
put the pSavedDataGrids of tThisStack into aSavedDataGrids
if aSavedDataGrids is not an array then
answer info "Invalid arguement. pDataGrid must be an array." as sheet
exit restoreDataGrid
end if
if there is a group pDataGrid then delete group pDataGrid
copy group "DataGrid" of group "Templates" of stack "revDataGridLibrary" to tThisStack
put it into tDataGridRef
set the name of tDataGridRef to aSavedDataGrids [pDataGrid]["name"]
set the height of group pDataGrid to aSavedDataGrids [pDataGrid]["height"]
set the width of group pDataGrid to aSavedDataGrids [pDataGrid]["width"]
set the loc of group pDataGrid to aSavedDataGrids [pDataGrid]["loc"]
set the script of group pDataGrid to aSavedDataGrids [pDataGrid]["script"]
set the dgprop ["columns"] of group pDataGrid to aSavedDataGrids [pDataGrid]["columns"]
set the dgprop ["column labels"] of group pDataGrid to aSavedDataGrids [pDataGrid]["column labels"]
set the dgprop ["column widths"] of group pDataGrid to aSavedDataGrids [pDataGrid]["column widths"]
set the dgprop ["allow editing"] of group pDataGrid to aSavedDataGrids [pDataGrid]["allow editing"]
set the dgProp ["multiple lines"] of group pDataGrid to aSavedDataGrids [pDataGrid]["multiple lines"]
end restoreDataGrid
Bob S
> On Apr 18, 2018, at 10:43 , Terence Heaford via use-livecode <use-livecode at lists.runrev.com> wrote:
>
> All my tables just say
>
> button id 1005 of stack "revDataGridLibrary"
>
>
> Did the copy and paste thing and it did not work.
>
> ??
>
> Terry
More information about the use-livecode
mailing list