Philosophical DataGrid Questions
Posted: Thu Feb 04, 2010 7:50 pm
I am using a dataGrid with 16 columns and the number of rows will probably not exceed 30. Many of the columns have numbers in them that can be positive or negative and some of those I need to show either two or four decimal places. I am currently using the special button 'My Default Column Behavior' as suggested in Trevor's tutorial http://revolution.screenstepslive.com/s ... to-a-Cell- to make the negative numbers show up in red and the positive numbers to show up in green.
In order to make the numbers have a fixed number of decimal places I could insert code similar to the following in each of the Case statements of that button script to get the format I want:
Is this an efficient way to handle the number formatting?
A second question goes back even further. Since I have at least 10 columns that require special formatting, is the switch - case technique in the single button 'My Default Column Behavior' as efficient as having individual scripts (buttons) that the Column Inspector would give.
Finally, I have been avoiding any type of currency formatting in the columns because I need to add them up. I would prefer to have that formatting in US currency however if there is a good way to handle it. Any suggestions?
Regards and thanks,
Larry
In order to make the numbers have a fixed number of decimal places I could insert code similar to the following in each of the Case statements of that button script to get the format I want:
Code: Select all
...
set the numberFormat to "#.00" -- or #.0000 as the case requires
put pData * 1 into pData
...
A second question goes back even further. Since I have at least 10 columns that require special formatting, is the switch - case technique in the single button 'My Default Column Behavior' as efficient as having individual scripts (buttons) that the Column Inspector would give.
Finally, I have been avoiding any type of currency formatting in the columns because I need to add them up. I would prefer to have that formatting in US currency however if there is a good way to handle it. Any suggestions?
Regards and thanks,
Larry