DataGrid Scrollbar Issue
Posted: Sat Jun 01, 2013 5:07 pm
I am building an app where I display a DataGrid with a list of items in a substack of the main stack.
Depending on the number of items in the list and the height of the stack I turn the vertical scrollbar in the DataGrid on or off.
When I turn the scrollbar on, it does not appear when I open the substack for the first time.
If I close the substack and reopen it, the scrollbar appears.
I have not been able to resolve the issue by myself despite a lot of attempts, so I am reaching out for help here.
More details:
In the main stack I build the list of items for the DataGrid and put them into a global array var. Then I call the substack (as modal, but I also tried modeless).
In the preOpenCard handler of the substack, I determine and set the size of the substack (based on the size of the main stack), and whether I need a scrollbar.
Depending on the result, I set the dgProps:
A bit later in the handler I position the DataGrid field on the stack, set the row height, and populate the grid with the data from the global array.
Everything works as expected, except the issue that the scrollbar doesn't appear during the first display of the substack, and it does appear when I close the substack and reopen it again.
Any idea what might cause this issue and how to resolve it?
Depending on the number of items in the list and the height of the stack I turn the vertical scrollbar in the DataGrid on or off.
When I turn the scrollbar on, it does not appear when I open the substack for the first time.
If I close the substack and reopen it, the scrollbar appears.
I have not been able to resolve the issue by myself despite a lot of attempts, so I am reaching out for help here.
More details:
In the main stack I build the list of items for the DataGrid and put them into a global array var. Then I call the substack (as modal, but I also tried modeless).
In the preOpenCard handler of the substack, I determine and set the size of the substack (based on the size of the main stack), and whether I need a scrollbar.
Depending on the result, I set the dgProps:
Code: Select all
if tStackHeight > gStackHeight then
put gStackHeight into tStackHeight
set the dgProp["show vscrollbar"] of group "CategoryList" of me to true
set the dgProp["scrollbar width"] of group "CategoryList" of me to 12
else
set the dgProp["show vscrollbar"] of group "CategoryList" of me to false
end if
set the height of this stack to tStackHeight
Code: Select all
set the width of group "CategoryList" of me to tStackWidth
set the height of group "CategoryList" of me to (tStackHeight - gMenuHeight - gButtonSize)
set the left of group "CategoryList" of me to 0;
set the top of group "CategoryList" of me to gButtonSize
set the dgProp["row height"] of group "CategoryList" of me to gButtonSize
# populate the data grid and hilite line
set the dgData of group "CategoryList" to gDgData
set the dgHilitedLines of group "CategoryList" to gDgHilitedLines
Any idea what might cause this issue and how to resolve it?