DEVBUZZ Homepage Review of Odyssey Software's free DataViewer control for eVB
 
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

Review of Odyssey Software's free DataViewer control for eVB
Written by Pete Vickers  [author's bio]  [read 47547 times]
Edited by Derek

Download the code   Discuss this article   eVB Ver 3.0   

Page 1  Page 2  Page 3 

[Editor's note:] The day after the Pete's last article on the performance grid article was published, we were contacted by Odyssey Software asking if we wanted to test their virtual list view. What better person to review Odyssey's new (and free) control than the grid performance guru himself - Pete Vickers. Download this article's sample code and also check out Odyssey Software Developer Web Site. If you do contact Odyssey please mention this article. [Editor's note:]

Introduction

Odyssey are providing this control FREE to the developer community, and ROYALTY FREE distribution. As a software developer who buys controls, that is the kind of price I like. Then again, as a software developer who sells controls, I don't like the precedent. I think it is great of Odyssey to donate this control. This article will put it through its paces, and see if it is better than the grid, or normal listview.

I probably approached this from a jaundiced point of view, as I am a grizzled old developer, who generally has no truck with these newfangled 'bound' or ‘virtual’ controls. They make the job too easy - what is wrong with coding absolutely everything? Still, pushing aside my prejudices, away we go.

To quote from Odyssey...
"The DataViewer is very fast and much better than a regular ListView, Grid, or ComboBox. Especially the ComboBox because you can display multiple columns with column headings in the simulated combo (scrolling both vertically & horizontally), yet you can choose what column to return to the TextBox (used to hold the selection) when the user selects a record from the list. The main principal behind the DataViewer is that you are not loading up the control with a copy of your data, which the control then displays. Instead, you tell the control that you have data (and how much) and it will then ask you ONLY for the data it needs for the current viewport (displayable area of the DataViewer). So, it is really a virtual ListView control (report mode only). That is why the rendering speed of your data is always the same (typically < 1 sec.), regardless of the amount of data you have whether its 1 row or 100,000 rows.

This allows you to pull and display data directly from the data source (in most cases an ADOCE.Recordset) without loading a copy of the data in into the control (much more memory efficient and of course must faster)."

This fits in with what people have done with the grid control in the past, i.e. 'page' records.

I received a sample application from Odyssey, and used that as a test to see how easy the control was to use. I then developed an application (two as it turned out) from scratch, to gauge it from how easy it was to integrate into an application. Their sample used the northwind database. I decided to build a simple test database from scratch, and allow the developer to populate it with as many (or few) records as he liked, to test out the performance. This also allowed the sample application to demonstrate the use of Menus, and a simple progress bar. I also decided to add a simple edit facility.

The design of the form finished up as this:

The application would therefore allow us to:

  • Browse Records
  • Show a Tap and Hold
  • Respond to Tap and Hold
  • Retrieve records using 'movenext'
  • Retrieve records using getrows

Our menu has 4 items under the database menu:

    1. Drop the database
    2. Create the database
    3. Create the table
    4. Populate the table

In addition, we have an 'options' menu that will allow us to choose whether to use 'getrows' or ‘movenext’.

The real engine of the DataViewer is in the 'GetItemText', and is the one that is probably the most difficult to get your head around (it was for me, but hey, the brain cells are now dying rapidly!). The 'GetItemText' is much dependent on the rowcount property.

Effectively, we set the .rowcount to the number of the records in the recordset. We then give the dataview control the focus. This fires the 'GetItemText' event, passing in the row and column to popuplate...

Private Sub dvRecs_GetItemText(ByVal Row As Long _
, ByVal Column As Long, Text As Variant)

So, the very first time in, we are sent row = 1, column = 1. We then need to populate the 'text'. This is done here by a 'general' subroutine...

Text = CStr(GetRecordsetFieldValue _
(rs, Row, Column))

Private Function GetRecordsetFieldValue _
(rsSet As ADOCE.Recordset, _
lngRow As Long, lngColumn As Long) _
As Variant
If Not (rsSet.BOF And rsRecordset.EOF) Then
If Not rsSet.AbsolutePosition = lngRow Then
rsSet.Move (lngRow - rsSet.AbsolutePosition)
End If
If IsNull(rsSet(lngColumn - 1).Value) Then
GetRecordsetFieldValue = "(null)"
Else
GetRecordsetFieldValue = _
rsSet(lngColumn - 1).Value
End If
Else
GetRecordsetFieldValue = ""
End If
End Function

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