11/26/2024 8:26:09 AM
|
|
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.
|
|
|
|
Slow-loading DataGrids
Posted: 07 Sep 09 6:14 AM
|
Hello,
I have a datagrid that's pretty slow to load. Loading ~1200 records is taking about 8 seconds. (That's roughly timed, and includes form drawing etc)
I've had a look using Profiler, and it seems like the query is being executed twice, even though as far as I can see I'm only setting and showing the grid once when the form is loaded.
What can cause a Datagrid to load the query twice? |
|
|
|
Re: Slow-loading DataGrids
Posted: 08 Sep 09 3:19 AM
|
The OnChange will have an affect here. If the grid is databound then it will load-up on the first instance and, occasionally, again on the change. Check your code. You could set it to .Active = False, do your staff and then .Active = True with a .Refresh to make it load just once. |
|
|
|
Re: Slow-loading DataGrids
Posted: 08 Sep 09 8:59 AM
|
As of 7.2 the all datagrid controls refresh up to 4 times depending on BINDID, grid.SQL.TEXT = "Select ....", grid.REFRESH, and Set grid.DataSet = MyRS.
in the old days, you had to do a .Refresh.....
Not very evident with 4 rows.....with 1200, it is VERY evident. I've got one grid with 14,000 rows in it (all schools in the state of California tied to an Opportunity)....and this is absolutely excruciating.
Bottom line is to quiet the grid down, and prove it through the profiler. If it's firing twice or more, reexamine your code.
I tend to remove the BindID, don't change the SQL.TEXT, and don't use .REFRESH...instead build up a RecordSet in ADO and SET the grid to that recordset ONCE.
I've got several posts on this topic over the last year on this and the SLX forum (ActiveX control).
let me know when you decide to dump 1200+ rows from a grid to Excel, that's another slooooowwwww experience. solution posted previously. |
|
|
|
Re: Slow-loading DataGrids
Posted: 09 Sep 09 8:37 AM
|
Yes, opening a recordset via SQL and setting the grid to that recordset is definitely much faster. Another slow operation are groups with large numbers of rows. |
|
|
|
Re: Slow-loading DataGrids
Posted: 10 Sep 09 7:38 AM
|
Aah, good tips. I'll try settings the contents from a recordset as you say.
Thanks. |
|
|
|
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!
|
|
|
|
|
|
|
|