The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Data Grid editing and refresh
Posted: 17 Jun 07 4:21 AM
|
All,
I have a grid on a slx 7.0 form. Grid is bound to a view, owned by sysdba so I can use it like a normal table. I am clicking on the grid as normal and all is well. I can click on columns I have enabled and the editing fires and I see the events and control data updates.
All is well until.. I click on a row the is outside of the initial visible block on the grid.. i.e. if the grid could show 20 rows and I click on row 23…
Then after I update the database and execute a grid.refresh, the grid refreshes and updates but the row I clicked on jumps always to two from the bottom. The column (and row) I selected still holds but the location on the grid jumps.
The effect is if the mouse click by the user was in the middle of the screen (and grid), after The user clicked on the grid and updated the databased, and the grid refreshes, the row being clicked on jumps down to 2 from the bottom of the visible grid.
Now sortable = true, the row is not resorting because of data changes and everything is working as it should except that the block of data on the grid you are viewing moves.
Any thoughts. This is driving me crazy.
Kind regards
Brett Cruickshank CRM STRATEGY Australia.
|
|
|
|
Re: Data Grid editing and refresh
Posted: 22 Jun 07 10:59 AM
|
You aren't trapping for clicking on an invalid row? Why are you updating the database if their are only 20 rows and you click on row 23? Why are you doing a refresh when no change has been made to the existing recordset?
You also have to trap for clicking on Group Headers.....
all mouse clicks on the data grid were NOT created equal. |
|
|
|
Re: Data Grid editing and refresh
Posted: 25 Jun 07 3:06 PM
|
Row 23 is a valid row. She's saying that the initial "page" is for instance 20 rows. If a user scrolls down then selects row 23 out of 75 for instance, this problem occurs. She's also doing the refresh after an update, it's not unwanted.
I want to say the problem is sortable = true. If you're sorting by the column you change, it'll "jump" to the position it should be in the grid (theoretically). Problem is this is not always uniform and I believe I've seen it "jump" for columns that weren't even in the sort order to begin.
An alternative is to set sortable = false and use GroupPanel. Sortable sorts on the control itself, GroupPanel the underlying SQL. |
|
|
|
Re: Data Grid editing and refresh
Posted: 25 Jun 07 3:08 PM
|
Yea remember the problem where selected rows that were beyond the viewable grid are included in multi-selects? Even with Sortable = True?
Sortable true is necessary for loading the entire grid contents into memory. |
|
|
|
Re: Data Grid editing and refresh
Posted: 25 Jun 07 10:28 PM
|
OK, What I had to do in the end is turn off the ingrid editing because I needed a property like "First Displayed Scrolling row index" to make sure I keped the top row in view there so the row didnt jump.
I have since found out that no matter what you do, the refresh will move the row selected to second from the bottom.
In MS grids, you can set the rows in view so it doesnt jump. To fix, I have to change the grid to a Flex grid or like that has this control.
Thanks for the herlp thought. I appreciate it.
Brett |
|
|
|