Page 1 of 1
Datagrids and Geometry
Posted: Tue Nov 06, 2012 4:41 pm
by xclntdesign
I have a created a Datagrid with the both scrollbars set to Auto. I have also assigned Geometry to this Datagrid, so that when the stack resizes, the datagrid resizes with it (attached to the right and bottom of the stack). When I make the width of the stack smaller, I do not get the horizontal scrollbar on my datagrid (because of the amount of data, the vertical scrollbar is always visible).
Did I miss something?
Re: Datagrids and Geometry
Posted: Thu Nov 08, 2012 11:08 pm
by Mark
Hi,
Do you get the horizontal scrollbar if you resize the datagrid manually? Do the columns resize automatically when you resize the datagrid?
Mark
Re: Datagrids and Geometry
Posted: Fri Nov 09, 2012 3:33 pm
by xclntdesign
No and No. When I drag the right side handles in the IDE, I get no scrollbars and the columns do not resize.
I have a behavior assigned to this DataGrid. Could it be that a message isn't being passed, so it doesn't know what to do?
Re: Datagrids and Geometry
Posted: Fri Nov 09, 2012 4:31 pm
by xclntdesign
I was able to fix the scrollbar issue by making the initial column widths large enough to force the scrollbar to appear in the IDE.
How do I make the columns automatically resize?
Re: Datagrids and Geometry
Posted: Fri Nov 09, 2012 10:14 pm
by Mark
Hi,
I asked if the columns resized automatically, because that would explain why there is no horizontal scroll bar. I don't if there is a way to do this automatically without a script, but if I understand the documentation correctly, you can use the layoutControl message to resize controls and columns.
Honestly, I don't use the datagrid, so you'd probably better refer to the datagrid documentation. Perhaps, you can do the following in a datagrid group script (provided that you have 3 columns):
Code: Select all
on resizeControl
set the dgColumnWidth["Name"] of group "DataGrid" to the widht of grp "Data Grid" / 3
pass resizeControl
end resizeControl
and probably this script in a field of your DG template:
Code: Select all
on layoutControl theRect
set the rect of fld "My Only Field" to theRect
end layoutControl
This script would assume that the DG has 3 columns and in one of those columns 1 single field.
I hope this helps.
Kind regards,
Mark