General information
Category:
ActiveX controls in VFP
Title:
Help! Problem in ProtoView Explorer
Dear All,
has anyone got the dynamic allocation of a collection of column headers to work in Protoview's Explorer? I keep getting a "parameter is not optional" message (see sample code below). For me, this completely invalidates their claim that the Explorer is MS Visual Studio compliant, since if this I implement our app in VFP with this bug, the performance hit of updating all the nodes in the treeview will kill us stone dead. Does anyone have a workaround?
I've contacted both the sales and tech support of Protoview, but no reponse for a week.
Best wishes,
Neil
Here is how to reproduce the problem:
1 - Create a new form in Visual FoxPro
2 – Drop an instance of the Protoview Explorer onto it. Rename the control as PVExplorer1
3 – Paste this code into the Init method of the form
&&&&&& -----------------------Start
#define pvxReport 3
#define pvxLast -2
#define pvxListViewPane 2
this.PVExplorer1.ListView.View = pvxReport
DefaultColumns = this.PVExplorer1.TreeView.DefaultColumnHeaders
SpecialColumns = this.PVExplorer1.ColumnHeadersSet.Add("ColSet1")
Column = DefaultColumns.Add(0, "Last Name", 120, 0)
Column = DefaultColumns.Add(1, "First Name", 100, 0)
Column = DefaultColumns.Add(2, "Address", 200, 0)
Column = DefaultColumns.Add(3, "Telephone", 50, 0)
Column = SpecialColumns.Add(0, "Product ID", 80, 0)
Column = SpecialColumns.Add(1, "Price", 40, 0)
Column = SpecialColumns.Add(2, "Quantity", 40, 0)
Nodes = this.PVExplorer1.TreeView.Nodes
Node = Nodes.AddRootNode("Default Columns", 0, 1)
Node.ViewerType = pvxListViewPane
*Add a ListItem with subitems in accordance with the default ColumnHeaders
Item = Node.ListItems.Add(pvxLast, "Simon", 1, 1)
Item.SubItems(1) = "John"
Item.SubItems(2) = "282 Manor Rd."
Item.SubItems(3) = "389 834-3849"
*Step3
* Add 1 node which uses the Special column headers.
Node = Nodes.Add(Node, pvxLast, "Special Columns", 0, 1)
Node.ViewerType = pvxListViewPane
Node.ListItems.ColumnHeaders = SpecialColumns
*Step4
* Add a ListItem to the Node ListItems collection
* then set the text of the ListItem subitems according to the column headers used by the associated node.
Item = Node.ListItems.Add(pvxLast, "12341", 1, 1)
Item.SubItems(1) = "$44.95"
Item.SubItems(2) = "6"
&&&&&& ---------------------- End
4 – Run the code.
You should get a “parameter is not optional” error on the line "Node.ListItems.ColumnHeaders = SpecialColumns".
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only