Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Tuesday, November 26, 2024 
 
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!
 Architect Forums - Controls
Forum to discuss usage & tips for SalesLogix controls and other 3rd party ActiveX controls. View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to Controls | New ThreadView:  Search:  
 Author  Thread: Slow-loading DataGrids
Mark Hanford
Posts: 131
 
Slow-loading DataGridsYour last visit to this thread was on 1/1/1970 12:00:00 AM
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?
[Reply][Quote]
Mike Spragg
Posts: 1226
Top 10 forum poster: 1226 posts
 
Re: Slow-loading DataGridsYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Slow-loading DataGridsYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Robert Levine
Posts: 132
 
Re: Slow-loading DataGridsYour last visit to this thread was on 1/1/1970 12:00:00 AM
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.
[Reply][Quote]
Mark Hanford
Posts: 131
 
Re: Slow-loading DataGridsYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 10 Sep 09 7:38 AM
Aah, good tips. I'll try settings the contents from a recordset as you say.

Thanks.
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2024 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 11/26/2024 11:42:05 AM