Can't find clear answer to this, hopefully someone here can answer:
I have a datagrid with 3 columns that occupies the width of a stack.
I want the columns to resize when the stack resizes so that extra 'non-column' doesn't appear.
I edited the on resizeStack pNewWidth, pNewHeight, pOldWidth, pOldHeight handler in the card script with
Code: Select all
set the dgColumnWidth["col 1"] of group "data grid 1" to round(pNewWidth/3) set the dgColumnWidth["col 2"] of group "data grid 1" to round(pNewWidth/3) set the dgColumnWidth["col 3"] of group "data grid 1" to round(pNewWidth/3)
I then wanted to use the row/column template for formatting but can't - the '+' buttons just don't do anything when clicked and it's not possible to add behaviour/templates.
As a test, I then created a new stack with a similar data grid, but this time i created the row/column templates first.
Great, thant works fine.
BUT - when i put the above script in the card's 'On resizeStack' handler, nothing happens - i can't resize the columns when resizing the stack this way if a template is set, it seems.
It seems that you can't only use templates/behavious if none of the data grid's properties are modified elsewhere? And if you do have templates then you can't modify the data grid properties from scripts elsewhere?
Is it possible to get access the datagrid width from within the template? how else would you resize columns?