11/29/2024 8:32:27 PM
|
|
slxdeveloper.com Community Forums |
|
|
|
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!
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
|
|
|
|
DataGrid Primer: quiet down the grid and speed up the display
Posted: 30 Jan 09 8:05 AM
|
SLX Grid Efficiencies.
Overview: Data Grids (grid) are a standard design element for displaying a 1:M list of records. 1 Account:Many Contacts....display the Account's Contacts in a grid on a form.
Programmatically: Grid displays are filled in by a grid method: REFRESH. Up until SLX 7.2, Grid Refreshes were 'fired off' by a simple script:
Sub ABC gridname.REFRESH END SUB
Now in 7.2+ SLX is firing Grids off: a) gridname.REFRESH b) When the GridName.BINDID changes (if the BINDID is the AccountID, then changing to a different account changes the Bindid, and the Grid Refreshes. c) When the BINDID is specified in the GridName.SQL.TEXT (ACCOUNTID = :BINDID). d) When the GridName.RecordSet is set to a new RecordSet.
In the past, if you: GridName.BINDID = strACCOUNTID GridName.SQL.TEXT = "SELECT ......" GridName.REFRESH
SLX would fire off the Refresh ONCE. Now it does it 3 or 4 times.
With 5 rows, no big deal. With 14,000 rows, this is a real problem.
Issue: slow grid refreshes, user waiting, nothing happening to the screen, SLX appears frozen.
Solutions: 1. Quiet down the grid, limit the number of refreshes, and speed up the grid display. 2. Make sure that the SELECT and joins are as efficient as possible. Limit the number of columns, rows, use indexed fields for joins. Look into record set refreshes. Utilize SQL Native Connections where applicable. 3. Provide 'waiting messages' and progress bars to the user. Hide controls that we don't want the user to click on when the data is being retrieved and the grid display being built.
Implementation of solutions: 1. Quiet Down The Grid a) remove BINDID property from Grid. Careful: make sure you have an invisible Edit Box data bound to the table ID field on the base of the form! This fires off the AXFormChange. b) remove BINDID reference in the SQL Property c) in the AXFormOpen of the Form itself, set the GridName.SQL.TEXT = "" d) in the AXFormChange of the Form itself, set the SQL.TEXT and that fires off the grid! e) when you want to fire off the grid AGAIN either do a SET GridName.RecordSet = yourADORS OR GridName.SQL.TEXT = "Select ...... WHERE ACCOUNTID = '" & strBINDID & "' " >>> DO NOT DO a .REFRESH after this! OR .REFRESH OR Application.BasicFunctions.REFRESHMainView
Never more than one of these, unless absolutely necessary!
2. Efficient SQL: for read only data displays, use a SQL Connection rather than a SLX Database Connection.
3. Just before you do the refresh, set panels and displays to .VISIBLE = FALSE. after the Refresh, set controls back to .VISIBLE = TRUE
4. Testing: Run SLXProfile.exe and watch how many grid selects you are running on a form. Do this on the old form as well as the new form.
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|