DEVBUZZ Homepage Performance Grid
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | Starting Out

Performance Grid
Written by Pete Vickers  [author's bio]  [read 46083 times]
Edited by Derek

Download the code   Discuss this article   eVB Ver 3.0   

Page 1  Page 2  Page 3 

This article was inspired by a recent project, Pocket RDA. Pocket RDA provides remote data access from the Pocket PC to any ADO compliant database. The results were returned into a grid control, and could be saved or copied to the clipboard.

In 'program' testing, things looked great (don't they always!!), the 30 or so customer records returned quickly. (As we all know, most 'programmer testing' is carried out with the same 10 records.) I was a bit more concerned with the performance of 100 plus records, but decided it was probably network load (software guys blame the hardware - hardware guys blame the software!).

Then when I got into 'real' testing with 2000 records plus, it crawled to a standstill.

I was using a progress bar, but it was too 'wide' to show exactly what was going on, so I decided to add a display of a record counter to the program. For the first 100 records or so, the counter 'turned' so quickly you could not see it, but then it started to really slow down, turning at approx 1 record per second. The grid was invisible to start with, and just made visible at the end of the run. It looked like the more records I added to the grid, the slower it got. This led me to do some experimentation with the grid control, and the following represents my conclusions.

This subject has been discussed on the forums several times, and several ways to speed up the display have been suggested:

1) Make the grid visible false, fill it and then visible true. I was already doing this, so not an option.

2) 'Page' the control, e.g. show 20 records. When the user scrolled down, use the scroll event in conjunction with the toprow value to go to the database for more records, i.e.

Private Sub grdRes_Scroll()
If grdRes.TopRow + 8 >= grdRes.Rows Then
If Not End_Of_File Then
grdRes.Visible = False
WaitCursor True
Get_Next_Records
End If
End If
End Sub

This worked, but I was not happy with the results.

3) Use a different control, i.e. a text box or a listview control. Maybe, but they could be as slow, and were not exactly what I wanted, as I wanted the user to be able to select a column from the grid, and this would be impossible in a text box or a listview (or would it?). I was also happy with a grid, as users are used to data being presented that way.

Rather than mess with my code, I did what all developers do, and with apologies to Walt, wrote a 'Micky Mouse' to test my theories.

The idea was to have a grid control, a text box and a listview, set up a loop to add 1000 lines of 5 items in each, and then decide what to do next. The form below shows the controls, and also a listbox, to display the results of the timing.

Next Page 

Back to Starting Out | [Article Index]

 

Back to the top of the page.
Chris De Herrera's Windows CE Website Windows CE News & Information Source
Copyright ©2000-2007 by DEVBUZZ.COM, Inc., NJ. USA.MSDEVELOP