Page 1
Page 2
Page 3
The DataViewer does not support the
same 'sorted' property as the standard listview. That SHOULD
not be a problem. What IS supported is an 'arrow' in the
header, either up or down. You can trigger your own sort
using this. It means that you access the data again using
'ORDER BY ' and either 'ASCENDING' or 'DESCENDING'. Again,
this could be slow. A faster method may be to use ORDER_BY
with GetRows, or choose to sort the original array
using your own sort routine(see below).I would say
it is 'horses for courses' - use whichever method seems
appropriate for your particular task.

I realise that not everything is a database
application - you may wish to use the DataViewer for 'non-bound'
data. Consequently, enter sample application 2. This will
read from a 'flat file', and display the data. I decided
to use a simple CSV file, and make the application similar
to the database application.

We use an array (xcols) to store the
data...
Dv.RowCount = 0
lrows = 0
Erase xcols
While Not File1.EOF
Strinput = File1.LineInputString
lRows = lRows + 1
ReDim Preserve xcols(lRows - 1)
xcols(lRows - 1) = Split(Strinput, ",")
Wend
File1.Close
Dv.ColumnCount = UBound(xcols(0)) + 1
For Ict = 0 To UBound(xcols(0))
Dv.ColumnHeader(Ict + 1) = _
"Column #" & Ict + 1
Next
Dv.RowCount = lRows
The statement 'Dv.Rowcount = lrows'
triggers the 'GetItemText' event. This time, the event is....
Text = xcols(Row - 1)(Column - 1)
Again, we have implemented a 'tap and
hold' menu in this application. We have also implemented
a 'shell sort' for sorting the array.

I suggest you tinker with the test applications
(and the ones supplied by Odyssey) to get used to the control.
DataViewer control Summary
As I said at the beginning of
the review, I am not a fan of 'bound' or virtual
controls. The DataViewer has gone quite a long way to make
me change my mind. Once I got my head around the methods
(not easy at my time of life), I found it easy to use.
Likes
- I like the fact it supports a contextmenu,
as I think this is vital to the design of
most applications. I currently use a message hook to get
around this in the listview and the treeview.
- I like the ability to use either
'movenext' or 'getrows' as this allows much needed flexibility.
I also like the way unbound data can be used.
- As the control is derived from the
listview, the LVM messages can be used. The 'flat file'
sample shows how to resize based on the whichever is widest,
the column header or the column, using LVM_SETCOLUMNWIDTH.
I have not tried out the other LVM messages.
- I am also pleased with the performance.
Dislikes
Conclusion
I think Odyssey should be congratulated
on this control. There are surprisingly few third party
controls for eVB compared to the massive third party market
in VB Controls. The DataViewer will be the answer to quite
a few developers prayers. I will certainly be using
it in some of my projects, and will be testing it with my
own remote data access software. Odyssey tell me that the
DataViewer works with their remote data access software
such as ViaXML and CeFusion and has included examples in
the installation pack.
The DataViewer control is FREE and can
be downloaded from the Odyssey Software Developer Web Site
at http://www.odysseysoftware.com/support.html
In addition, the samples used in this
article are available to download. Thanks to the folks at
Odyssey for their help and support.
Previous Page