Controlling grouped objects
Posted: Wed Apr 23, 2014 2:16 pm
Hi Guys,
On a roll now, things seem to be finally falling into place. I do have another query, its more to do with efficiencies of grouped objects.
I have a two fields laid out next to each other aligned top with both the heights set to 21 (indicating a single line). The fields are called description and price. I have placed a solid rectangle around both fields. I have then grouped all three objects together and called it myPriceRow.
The question is the description field may contain x number of lines and I want the field to autoresize to display all the content of the field. So checking out the dictionary I came across the formattedheight command. I figured out that I can obtain the formattedheight of the content within the description field and then set the height of the description field so that its slightly greater than the formatted height of the content. This seemed to work fine, however two things I noted as issues.
1) When I set the height of the description field, the field increases in size from the centre outward, making description and price aligned in the centre rather than the top. Is there a way I can lock the top location before I set the height of description, so it grows downward? If not I will just have to get the top location of description before its grown and then readjust the alignment of the fields afterwards.
2) The second thing was, the solid rectangle which was around the fields needs to grow as well depending on the description field size. I can manually set the height of the rectangle object so it’s the formattedheight +10. However because I’ve grouped the items together, can I somehow use the groups properties to extend the description field and the solid rectangle in one line of code?
Both of the these things above I can do manually, I was mainly querying if grouping the objects I can write less lines to expand both the description field and the rectangle surrounding it.
Finally, not related, but curious. What are template controls? Do we only have datagrid row template controls or would my grouped object myPriceRow which I use again and again in a script be considered a templated control? I know datagrids contain template controls, do most of you use template controls for repetitive things or have I misinterpreted the word ‘templated’.
Thanks once again
Jalz
On a roll now, things seem to be finally falling into place. I do have another query, its more to do with efficiencies of grouped objects.
I have a two fields laid out next to each other aligned top with both the heights set to 21 (indicating a single line). The fields are called description and price. I have placed a solid rectangle around both fields. I have then grouped all three objects together and called it myPriceRow.
The question is the description field may contain x number of lines and I want the field to autoresize to display all the content of the field. So checking out the dictionary I came across the formattedheight command. I figured out that I can obtain the formattedheight of the content within the description field and then set the height of the description field so that its slightly greater than the formatted height of the content. This seemed to work fine, however two things I noted as issues.
1) When I set the height of the description field, the field increases in size from the centre outward, making description and price aligned in the centre rather than the top. Is there a way I can lock the top location before I set the height of description, so it grows downward? If not I will just have to get the top location of description before its grown and then readjust the alignment of the fields afterwards.
2) The second thing was, the solid rectangle which was around the fields needs to grow as well depending on the description field size. I can manually set the height of the rectangle object so it’s the formattedheight +10. However because I’ve grouped the items together, can I somehow use the groups properties to extend the description field and the solid rectangle in one line of code?
Both of the these things above I can do manually, I was mainly querying if grouping the objects I can write less lines to expand both the description field and the rectangle surrounding it.
Finally, not related, but curious. What are template controls? Do we only have datagrid row template controls or would my grouped object myPriceRow which I use again and again in a script be considered a templated control? I know datagrids contain template controls, do most of you use template controls for repetitive things or have I misinterpreted the word ‘templated’.
Thanks once again
Jalz