Problem with datagrid and automatic sorting...
Posted: Mon Apr 01, 2013 8:44 am
Hello,
I have an application that contains a datagrid with 3 columns.
Column 1 is a checkbox
Column 2 is a word
Column 3 is a number
In the application, the user is able to click the checkbox (column 1) and
use a right click menu to delete that row of the datagrid.
Or the user can check multiple checkboxes, and use the right click menu
to "delete all checked rows".
Here is the problem.
Let's say there are 300 rows in the datagrid, and a scrollbar is used to
scroll to the bottom rows of the datagrid.
When the user checks a checkbox after scrolling to the bottom, the entire datagrid then scrolls back
to the top, which keeps the user from checking more than one box at a time
when scrolled down and they are forced to then scroll back down again and check the next box, etc...
I was able to set a breakpoint and find the specific line of code that causes
the datagrid to scroll back to the top when a checkbox is checked.
41 lock screen
42 set the dgData of me to tArray
43 put the dgProp["sort by column"] of group "DataGrid 1" into tSortedColumn
44 send "SortDataGridColumn" && tSortedColumn to group "DataGrid 1"
45 unlock screen
In the above code, as soon as line 42 is executed, the datagrid automatically
scrolls back to the top.
Hope someone has some ideas to test.
Thank you!
I have an application that contains a datagrid with 3 columns.
Column 1 is a checkbox
Column 2 is a word
Column 3 is a number
In the application, the user is able to click the checkbox (column 1) and
use a right click menu to delete that row of the datagrid.
Or the user can check multiple checkboxes, and use the right click menu
to "delete all checked rows".
Here is the problem.
Let's say there are 300 rows in the datagrid, and a scrollbar is used to
scroll to the bottom rows of the datagrid.
When the user checks a checkbox after scrolling to the bottom, the entire datagrid then scrolls back
to the top, which keeps the user from checking more than one box at a time
when scrolled down and they are forced to then scroll back down again and check the next box, etc...
I was able to set a breakpoint and find the specific line of code that causes
the datagrid to scroll back to the top when a checkbox is checked.
41 lock screen
42 set the dgData of me to tArray
43 put the dgProp["sort by column"] of group "DataGrid 1" into tSortedColumn
44 send "SortDataGridColumn" && tSortedColumn to group "DataGrid 1"
45 unlock screen
In the above code, as soon as line 42 is executed, the datagrid automatically
scrolls back to the top.
Hope someone has some ideas to test.

Thank you!