Tutorials

For these tutorials, all information will be given regarding Visual Studio 6. The run-time code should be backward compatible with Visual Basic 5 (except for hierarchical binding). For hierarchical data-binding, you need to be using Visual Studio 6.x, or at least the Data Access SDK 2.0 which installs the ADO Data Control (ADC DC) and the MDAC components. Currently Visual Basic 5.0 does not have support for design-time data binding with ADO Data-Bound controls. If you wish to bind to TreeViewX 3.0, you will need to do this at run-time.

Visual Basic

The following Visual Basic tutorials are offered:

Binding using ADO DC at Design-Time, Non-Hierarchical

  1. Start VB 6
  2. Create a new "Standard EXE" project
  3. Add the ADO DC and TreeViewX to your Project and place them on your form.
  4. Right-click on the ADO DC and select "Properties"
  5. On the "General" Property page, select "Use ODBC Data Source Name"
  6. Select your "Jet NorthWind connection" -- You may need to set this up through the ODBC 32-bit Administrator through your Control Panel beforehand (or select New)
  7. On the "RecordSource" Property page, select "adCmdTable" from the "Command Type" combobox
  8. Select the "Customers" table from the "Table or Stored Procedure Name" combobox
  9. Click OK
  10. Select TreeViewX on the form
  11. In the "Standard Properties Window" in VB, change the DataSource property to the ADO DC
  12. Right-click on TreeViewX and select "Properties..."
  13. On the Data-Binding Property Page, double-click on "CompanyName" in the Available Columns list.
  14. Click on OK to close the Property Pages
  15. Run your application.

Binding using ADO DC at Run-Time, Non-Hierarchical

This only shows a basic table. For a hierarchical view, please refer to the sample in VC 6 using the ADO DC.

  1. Start VB 6
  2. Create a new "Standard EXE" project
  3. Add the ADO DC and TreeViewX to your Project and place them on your form.
  4. Right-click on the ADO DC and select "Properties"
  5. On the "General" Property page, select "Use ODBC Data Source Name"
  6. Select your "Jet NorthWind connection" -- You may need to set this up through the ODBC 32-bit Administrator through your Control Panel beforehand (or select New)
  7. On the "RecordSource" Property page, select "adCmdTable" from the "Command Type" combobox
  8. Select the "Customers" table from the "Table or Stored Procedure Name" combobox
  9. Click OK
  10. Double click on the background of the form to edit the code for the Form Load sub
  11. Add the following lines of code:

    PVTreeViewX1.DataField(0) = "CompanyName"
    PVTreeViewX1.DataSource = Adodc1
  12. Run your application

Note: Before attempting to bind TreeView hierarchically, please be sure that you understand the purpose of the DataField property and how to use it.

One of the new features of Visual Basic 6.0 is the DataView which allows you to easily set up a hierarchical recordset at design-time. Here’s how to use hierarchical recordsets with TreeViewX:

Binding using DataView at Design-Time, Hierarchical

Here, we will show how to bind three levels deep.

  1. Start VB 6
  2. Create a new "Standard EXE" project
  3. Add TreeViewX to your Project and place it on your form
  4. On the Toolbar in VB 6, you should have an icon for the DataView Window which looks like:
    , click on it. This will bring up the DataView Window.
  5. On the DataView Window, click on the second toolbar button, "Add a Data Environment to the Current Project". Click on it...
  6. In the DataEnvironment Window, click on Connection1, and in the Standard Properties Window, change the "(Name)" field from "Connection1" to "NWind"
  7. Back in the DataEnvironment Window, Connection1 should now be NWind. Right-click on it, and select "Properties..."
  8. Select "Microsoft OLE DB Provider for ODBC Drivers", and click on Next
  9. Select your NorthWind Jet DataBase under the Data Source Name combobox. You may need to set this up through your 32-bit ODBC Administrator in your Control Panel.
  10. Click on "Test Connection". You should get message box that says "Test connection succeeded"
  11. Click on OK, click on OK.
  12. In the DataView Window, NWind should now be listed under "Data Environment Connections" with a plus sign. Click on the plus sign to expand it.
  13. Click on the plus sign next to "Tables" to expand it
  14. Drag "Customers" from the DataView Window to the DataEnvironment Window.
  15. Repeat step 14 for "Orders" and "Order Details"
  16. In the DataEnvironment Window, right-click on Orders, and select "Properties..."
  17. Click on the Relation tab, and check "Relate to a Parent Command Object"
  18. In the Parent Command combobox, select "Customers"
  19. In the Relation Definition section on that property page, you should now have CustomerID in both comboboxes, if so click on Add. If not, select CustomerID in both comboboxes then click on Add
  20. Click on OK
  21. Right-click on "Order_Details" in the DataEnvironment Window and select "Properties..."
  22. Click on the Relation tab, and check "Relate to a Parent Command Object"
  23. In the Parent Command combobox, select "Orders"
  24. In the Relation Definition section on that property page, you should now have OrderID in both comboboxes, if so click on Add. If not, select OrderID in both comboboxes then click on Add
  25. Click OK
  26. Close the DataView Window
  27. Your DataEnvironment Window should now contain a hierarchical representation of three tables from the NorthWind Database. Close the DataEnvironment Window
  28. Select TreeViewX on the form.
  29. In the Standard Properties Window in VB, change the DataSource property to "DataEnvironment1"
  30. Change the DataMember property to "Customers"
  31. Right-click on TreeViewX and select "Properties"
  32. On the Data-Binding Property page, expand "Customers", scroll down and expand "Orders", scroll down and expand "Order_Details"
  33. Scroll back up and double-click on "CompanyName" which should be a child of "Customers".
  34. Scroll down and double-click on "OrderID" which should be a child of "Orders"
  35. Scroll down and double-click on "ProductID" which should be a child of "Order_Details"
  36. Click on OK to close the Property Pages
  37. Run your project

When you run your project, you will get a list of company names. Under each company is all the orders associated with that company. Under each Order is all the products for that order.

Binding using DataView at Run-Time, Hierarchical

  1. Start VB 6
  2. Create a new "Standard EXE" project
  3. Add TreeViewX to your Project and place it on your form
  4. On the Toolbar in VB 6, you should have an icon for the DataView Window which looks like:
    , click on it. This will bring up the DataView Window.
  5. On the DataView Window, click on the second toolbar button, "Add a Data Environment to the Current Project". Click on it...
  6. In the DataEnvironment Window, click on Connection1, and in the Standard Properties Window, change the "(Name)" field from "Connection1" to "NWind"
  7. Back in the DataEnvironment Window, Connection1 should now be NWind. Right-click on it, and select "Properties..."
  8. Select "Microsoft OLE DB Provider for ODBC Drivers", and click on Next
  9. Select your NorthWind Jet DataBase under the Data Source Name combobox. You may need to set this up through your 32-bit ODBC Administrator in your Control Panel.
  10. Click on "Test Connection". You should get message box that says "Test connection succeeded"
  11. Click on OK, click on OK.
  12. In the DataView Window, NWind should now be listed under "Data Environment Connections" with a plus sign. Click on the plus sign to expand it.
  13. Click on the plus sign next to "Tables" to expand it
  14. Drag "Customers" from the DataView Window to the DataEnvironment Window.
  15. Repeat step 14 for "Orders" and "Order Details"
  16. In the DataEnvironment Window, right-click on Orders, and select "Properties..."
  17. Click on the Relation tab, and check "Relate to a Parent Command Object"
  18. In the Parent Command combobox, select "Customers"
  19. In the Relation Definition section on that property page, you should now have CustomerID in both comboboxes, if so click on Add. If not, select CustomerID in both comboboxes then click on Add
  20. Click on OK
  21. Right-click on "Order_Details" in the DataEnvironment Window and select "Properties..."
  22. Click on the Relation tab, and check "Relate to a Parent Command Object"
  23. In the Parent Command combobox, select "Orders"
  24. In the Relation Definition section on that property page, you should now have OrderID in both comboboxes, if so click on Add. If not, select OrderID in both comboboxes then click on Add
  25. Click OK
  26. Close the DataView Window
  27. Your DataEnvironment Window should now contain a hierarchical representation of three tables from the NorthWind Database. Close the DataEnvironment Window
  28. Add the following code to the Form Load:

    PVTreeViewX1.DataField(0) = "Customers.CompanyName"
    PVTreeViewX1.DataField(1) = "Orders.OrderID"
    PVTreeViewX1.DataField(2) = "Order_Details.ProductID"
    PVTreeViewX1.DataMember = "Customers"
    PVTreeViewX1.DataSource = DataEnvironment1
  29. Run your project

NOTE: When binding to a single level, you only need to specify the Field Name in DataField(0). If you are binding to multiple level as this example shows, you need to specify the [Table Name].[Field Name] as shown.

The DataMember property specifies which level TreeViewX should begin access to. If, for instance, you don’t want to see the Customer’s information, just Orders and Order Details, then specify the DataMember to be "Orders" and TreeViewX will only have access to Orders and Order_Details.

Visual C++

The following Visual C++ tutorials are offered:

Binding using ADO DC at Design-Time, Non-Hierarchical

(Note: At the time of this release, design-time data binding in Visual C++ 6.0 is disabled.  All data-binding should be done at run-time)

  1. Run Microsoft VC++ 6.0
  2. Select File | New
  3. On the Projects tab, select "MFC AppWizard (exe)"
  4. Enter the location for the project
  5. For this sample, we will use the name "vcsamp" for the Project name.
  6. Make sure "Create new workspace" is selected, and Platforms is "Win32"
  7. Click on OK
  8. Select "Dialog Based"
  9. Click Finish, click OK
  10. From the main menu, select Project | Add to Project | Components and Controls
  11. Double-click the folder "Registered ActiveX Controls"
  12. Scroll over to "Microsoft ADO Data Control ..." and double-click on it.
  13. Click on OK to insert the component
  14. Click on OK to generate the classes
  15. Repeat steps 12-14 for "ProtoView TreeViewX v3.0"
  16. Click on Close to close the Components and Controls Gallery
  17. Delete the "TODO:" static field from the dialog
  18. Place a TreeViewX control on your dialog, and the ADO DC
  19. Right-click on the ADO DC and select "Properties"
  20. On the Control tab, select "Use ODBC Data Source Name"
  21. Select your "Jet NorthWind connection" -- You may need to set this up through the ODBC 32-bit Administrator through your Control Panel beforehand (or select New)
  22. On the "RecordSource" Property page, select "adCmdTable" from the "Command Type" combobox
  23. Select the "Customers" table from the "Table or Stored Procedure Name" combobox
  24. Close the properties window
  25. Right-click on TreeViewX and select "Properties"
  26. Click on the right-arrow to move to the All property page and view the All property page
  27. Change the DataSource property to IDC_ADODC1
  28. Move the the Data-Binding property page
  29. Double-click on "CompanyName"
  30. Close the property window
  31. Build and run your application

Binding using ADO DC at Run-Time, Non-Hierarchical

  1. Start Microsoft Visual C++
  2. Select File | New from the main menu
  3. On the Projects tab, select "MFC AppWizard (exe)"
  4. Enter a location and name for the project. In this sample, we will use vcsamp again
  5. Click OK
  6. Select "Dialog Based", then click Finish
  7. Click OK
  8. From the main menu, select Project | Add to Project | Components and Controls
  9. Double-click on the Registered AcitveX Controls
  10. Scroll over to "Microsoft ADO Data Control" and double-click on it
  11. Click OK to insert the component, click OK to generate the classes
  12. Repeat steps 10 & 11 for "ProtoView TreeViewX v3.0"
  13. Click on Close to close the Components and Control Gallery
  14. Delete the TODO static field on the dialog, then place TreeViewX and an ADO DC on the dialog
  15. Right-click on the ADO DC and select Properties
  16. On the Control tab, select Use ODBC Data Source Name, and select your NorthWind Jet Data Source. You may need to set this up through your 32-bit ODBC Administrator in Control Panel beforehand.
  17. On the RecordSource tab, select adCmdTable under the Command Type combobox
  18. Select "Customers" in the Table or Stored Procedure Name combobox
  19. Close the Properties dialog
  20. Press Ctrl-W to enter ClassWizard (or select it from the View menu)
  21. On the Member Variables tab, double-click on IDC_ADODC1.
  22. Give this control the name m_adodc. Make sure the Category is Control and Variable type is Cadodc, then click OK
  23. Double-click on IDC_PVTREEVIEWXCTRL1
  24. Give this control the name m_treeview. Make sure the Category is Control and Variable type is CPVTreeView3, then click OK.
  25. On the Message Maps tab, you should have OnInitDialog listed under the Member functions. Double-click on it to edit the code
  26. Look for "// TODO: Add extra initialization here" in the function and add the following lines of code after the todo line, but before "return TRUE":

    m_adodc.Refresh();
    m_treeview.SetDataField(0, "CompanyName");
    m_treeview..SetDataSource(m_adodc.GetRecordset().GetDataSource());

    At the top of the file, add:

    #include "_recordset.h"
  27. Build and run your application.

Binding using OLE DB at Run-Time, Non-Hierarchical

This sample will show how to bind TreeViewX without the use of a data control at run-time.

  1. Start Microsoft Visual C++
  2. Select File | New from the main menu
  3. On the Projects tab, select "MFC AppWizard (exe)"
  4. Enter a location and name for the project. In this sample, we will use vcsamp again
  5. Click OK
  6. Select "Dialog Based", then click Finish
  7. Click OK
  8. From the main menu, select Project | Add to Project | Components and Controls
  9. Double-click on the Registered AcitveX Controls
  10. Scroll over to "ProtoView TreeViewX v3.0" and double-click on it
  11. Click OK to insert the component, click OK to generate the classes
  12. Click on Close to close the Components and Control Gallery
  13. Delete the TODO static field on the dialog, then place a TreeViewX on the dialog
  14. Press Ctrl-W to enter ClassWizard (or select it from the View menu)
  15. On the Member Variables tab, double-click on IDC_PVTREEVIEWXCTRL1
  16. Give this control the name m_treeview. Make sure the Category is Control and Variable type is CPVTreeView3, then click OK.
  17. On the Class Info tab, click on Add Class and select From a type library...
  18. Locate msado15.dll (typically in the /Program Files/Common Files/System/ado directory), and double-click on it.
  19. Select all the classes, and click on OK to generate the files
  20. On the Message Maps tab, select "CvcsampDlg" under Object Ids listbox.
  21. In the Message listbox, double-click on WM_CLOSE. This will add the member function to your application.
  22. On the Message Maps tab, you should have OnInitDialog listed under the Member functions. Double-click on it to edit the code
  23. Look for "// TODO: Add extra initialization here" in the function and add the following lines of code after this line, but before "return TRUE":

    // Your DSN=...; may be different. Please refer to your 32-bit ODBC Administrator

    // in Control Panel to get the correct name.

    COleVariant Connect( "DSN=OLE_DB_NWind_Jet;UID=;PWD=;" );

    COleVariant Source ( "SELECT * FROM Customers" );

    Rs1.CreateDispatch( "ADODB.Recordset.2.0", &e );

    Rs1.Open( (VARIANT) Source, (VARIANT) Connect, 0, 1, -1 );

    m_datatbl.SetAllowDBAutoConfig(TRUE);

    m_datatbl.SetDataSource(Rs1.GetDataSource());

  24. Locate the function void CVcsampDlg::OnClose() in the .cpp file.
  25. Right after the TODO marker and before the CDialog::OnClose(), add the following two lines before the "CDialog::OnClose" line:

    Rs1.Close();

    Rs1.ReleaseDispatch();

  26. Open the header file for this dialog, vcsampDlg.h
  27. Locate the following thress lines:

    //{{AFX_INCLUDES()
    #include "pvtreeview3.h"
    //}}AFX_INCLUDES
  28. Add the following line after it:

    #include "msado15.h"
  29. Locate the constructor, and directly after it, add the following two lines:

    _Recordset Rs1;
    COleException e;
  30. Save and close the header file
  31. Build and run your application

Binding using ADO DC at Design-Time, Hierarchical

This sample will show TreeViewX being bound at design-time to the ADO DC hierarchically

(Note: At the time of this release, design-time data binding in Visual C++ 6.0 is disabled.  All data-binding should be done at run-time)

  1. Run Microsoft VC++ 6.0
  2. Select File | New
  3. On the Projects tab, select "MFC AppWizard (exe)"
  4. Enter the location for the project
  5. For this sample, we will use the name "vcsamp" for the Project name.
  6. Make sure "Create new workspace" is selected, and Platforms is "Win32"
  7. Click on OK
  8. Select "Dialog Based"
  9. Click Finish, click OK
  10. From the main menu, select Project | Add to Project | Components and Controls
  11. Double-click the folder "Registered ActiveX Controls"
  12. Scroll over to "Microsoft ADO Data Control ..." and double-click on it.
  13. Click on OK to insert the component
  14. Click on OK to generate the classes
  15. Repeat steps 12-14 for "ProtoView TreeViewX v3.0"
  16. Click on Close to close the Components and Controls Gallery
  17. Delete the "TODO:" static field from the dialog
  18. Place a TreeViewX control and the ADO DC on your dialog.
  19. Right-click on the ADO DC and select "Properties"
  20. On the Control tab, select Use Connection String, and click on Build
  21. Click on MSDataShape, then click on Next
  22. On the Connection tab, enter the Data Source name for the NorthWind Jet Database in the Data Source field.
  23. Click on Test Connection. If it succeeds, click on OK and go to the next step. If it fails, then check your setting on this page. The only field that should be filled in it the Data Source field. The Data Source name you specify should match the name in your 32-bit ODBC Administrator.
  24. Right-click on the ADO DC again and select Properties to bring up the Properties dialog
  25. On the RecordSource tab, select adCmdText in the Command Type combobox
  26. In the CommandText (SQL) Edit field, enter in the following command:

    SHAPE {select * from Customers} APPEND ({select * from Orders} AS chapter RELATE CustomerID TO CustomerID)

    NOTE: For information on this command, please refer to the Microsoft help files.
  27. Close the Properties Dialog
  28. Right-click on TreeViewX, and select Properties
  29. On the All Property page, set the Data Source property to IDC_ADODC1
  30. Close the Properties Dialog
  31. Build and run your application

Binding using OLE DB at Run-Time, Hierarchical

  1. Start Microsoft Visual C++
  2. Select File | New from the main menu
  3. On the Projects tab, select "MFC AppWizard (exe)"
  4. Enter a location and name for the project. In this sample, we will use vcsamp again
  5. Click OK
  6. Select "Dialog Based", then click Finish
  7. Click OK
  8. From the main menu, select Project | Add to Project | Components and Controls
  9. Double-click on the Registered AcitveX Controls
  10. Scroll over to "ProtoView TreeViewX v3.0" and double-click on it
  11. Click OK to insert the component, click OK to generate the classes
  12. Click on Close to close the Components and Control Gallery
  13. Delete the TODO static field on the dialog, then place a TreeViewX on the dialog
  14. Press Ctrl-W to enter ClassWizard (or select it from the View menu)
  15. On the Member Variables tab, double-click on IDC_PVTREEVIEWXCTRL1
  16. Give this control the name m_treeview. Make sure the Category is Control and Variable type is CPVTreeView3, then click on OK.
  17. On the Class Info tab, click on Add Class and select From a type library...
  18. Locate msado15.dll (typically in the /Program Files/Common Files/ado directory), and double-click on it.
  19. Select all the classes, and click on OK to generate the files
  20. On the Message Maps tab, select "CvcsampDlg" under Object Ids listbox.
  21. In the Messages listbox, double-click on WM_CLOSE. This will add the member function to your application.
  22. On the Message Maps tab, you should have OnInitDialog listed under the Member functions. Double-click on it to edit the code
  23. Look for "// TODO: Add extra initialization here" in the function and add the following lines of code after this line, but before "return TRUE":

    // Your DSN=...; may be different. Please refer to your 32-bit ODBC Administrator
    // in Control Panel to get the correct name.
    COleVariant Connect( "Provider=MSDataShape;DSN=OLE_DB_NWind_Jet;UID=;PWD=;" );

    COleVariant Source ( "SHAPE {select * from Customers} APPEND ({select * from Orders} AS chapter RELATE CustomerID TO CustomerID)" );
    Rs1.CreateDispatch( "ADODB.Recordset.2.0", &e );
    Rs1.Open( (VARIANT) Source, (VARIANT) Connect, 0, 1, -1 );

    m_treeview.SetDataField(0, "Customers.CompanyName");

    m_treeview.SetDataField(1, "Orders.OrderID");

    m_treeview.SetDataSource(Rs1.GetDataSource());

    (Move this into its own sample)
    For Visual Basic, the code is as follows:

    Dim con As New ADODB.Connection

    Dim rs1 As New ADODB.Recordset

    con.Open "Provider=MSDataShape;DSN=OLE_DB_NWind_Jet;UID=;PWD=;"

    rs1.Open "SHAPE {select * from Customers} APPEND ({select * from Orders} AS Orders RELATE CustomerID TO CustomerID)", "Provider=MSDataShape;DSN=OLE_DB_NWind_Jet;UID=;PWD=;"

    PVTreeViewX1.DataField(0) = "Customers.CompanyName"

    PVTreeViewX1.DataField(1) = "Orders.OrderID"

    Set PVTreeViewX1.DataSource = rs1

  24. Locate the function void CVcsampDlg::OnClose() in the .cpp file.
  25. Right after the TODO marker and before the CDialog::OnClose(), add the following two lines:

    Rs1.Close();

    Rs1.ReleaseDispatch();

  26. Open the header file for this dialog, vcsampDlg.h
  27. Locate the following thress lines:

    //{{AFX_INCLUDES()
    #include "pvtreeview3.h"
    //}}AFX_INCLUDES
  28. Add the following line after it:

    #include "msado15.h"
  29. Locate the constructor, and directly after it, add the following two lines:

    _Recordset Rs1;
    COleException e;
  30. Save and close the header file
  31. Build and run your application

The samples above should give you a good idea on how to do some fairly complex data-binding. The previous tutorials should capture just about every aspect of data-binding. The following tutorials will show how to accomplish data-binding in Java (Visual J++) and several example of data-binding for Internet Development including RDS and ADO.

Visual J++

The following Visual J++ tutorials are offered:

Binding using OLE DB at Run-Time

  1. Run Microsoft Visual J++ 6.0
  2. If the "New Project" dialog box does not come up, choose File | New Project
  3. Select the Visual J++ Projects | Applications in the TreeView.
  4. Select Appliciation Wizard in the ListView.
  5. Enter a location and name. For this sample we will use jsamp.
  6. Click on Open
  7. Click on Next
  8. Select Form Based Application with Data, and click on Next
  9. Select ODBC and click on Next
  10. Select your NorthWind Jet DSN and click on Next
  11. Select Single record under Form layout, and click on Code, then click on Next
  12. Select Customers under the Record source combobox
  13. Move all fields to the right listbox
  14. Click on Finish
  15. On the Toolbox, right-click on the background and select "Customize toolbox..."
  16. On the ActiveX Controls tab, include ProtoView TreeViewX v3.0 and click on OK
  17. Select TreeViewX from the tools palette and place it on your dialog (after you make room for it)
  18. Right-click on the background of the dialog, and select View Code
  19. Search for the function "void openDataConnection()"
  20. Add the following lines as the last lines in the function:

    PVTreeViewX1.setDataField(0, new String("CompanyName"));
    PVTreeViewX1.setDataSource((msdatsrc.DataSource) m_rs.getDataSource());

    The typecasting is necessary here. Hopefully, as Visual J++ progresses to the point of Visual C++ or Visual Basic, this won’t be necessary.
  21. Build and run your project

As you’ll notice in this function, all the code is spelled out here on creating a recordset. You can simply modify this to make it hierarchical using the samples above.

Design-time data-binding is not available as of yet, so there are no samples for it in Java.

HTML and ASP

The following HTML and ASP tutorials are offered:

Binding using RDS at Design-Time

This sample assumes you already have the AdvWorks sample installed an running correctly on your IIS Server. If you do not have this sample, you can obtain it from http://www.microsoft.com/data/rds.

  1. Start Microsoft Visual InterDev 6.0 and either open up an existing Web Project containing the AdvWorks sample, or create a new Web Project using the AdvWorks Web. For information on how to do this, please refer to Microsoft’s InterDev help files.
  2. From the Project Explorer Window, right-click on <myserver>/<myWebProject> and select Add | Active Server Page...
  3. Select the Existing tab
  4. Move the the PVApps/TreeViewX/Samples/HTML/RDS directory (or PVApps/ActiveXSuite3/Samples/HTML/RDS
  5. Select the RDSTEMPLATE.ASP file and click on Open.
    This will add the page to your Web Project
  6. In the Project Explorer, double-click on RDSTEMPLE.ASP to open it.
    You will get a message box saying that an object failed to load and will be open as text. This is okay. It is the RDS Data Control. The RDS Data Control is not really a control, rather it is installed on the client side as part of Internet Explorer 4.x.
  7. If you do not already have TreeViewX on your Tools palette, right-click on the Tools Palette and choose Customize Toolbox. On the ActiveX Controls tab, check ProtoView TreeViewX v3.0 and click OK
  8. You should see a line with the following text:
    <!-- Insert ActiveX Controls here -->

    Drag TreeViewX from the Tools Palette and position it after this line.

    Because of the Design-time limitations of Visual InterDev, we will need to modify the Object Tag for TreeViewX to set the DataSource property. Right-click on TreeViewX and select "Always View As Text". The first line should appear as follows:

    <OBJECT classid="clsid:DB625B9A-05EA-11D2-97DD-00400520799C" id=PVTreeViewX1 style="LEFT: 0px; TOP: 0px" VIEWASTEXT>

  9. Scroll to the last line of the OBJECT tag, add this following paramater as the last one (don&rsquo;t forget to move the </OBJECT> to appear after the parameter you add):

    <PARAM NAME=DataSource datasrc=#adc>

    <OBJECT classid="clsid:DB625B9A-05EA-11D2-97DD-00400520799C" id=PVTreeViewX1 style="LEFT: 0px; TOP: 0px" VIEWASTEXT>
    <PARAM NAME="_Version" VALUE="196608">
    <PARAM NAME="_ExtentX" VALUE="5291">
    <PARAM NAME="_ExtentY" VALUE="4762">
    ...
    <PARAM NAME="DataField16" VALUE="">
    <PARAM NAME="DataField17" VALUE="">
    <PARAM NAME="DataField18" VALUE="">
    <PARAM NAME="DataField19" VALUE="">
    <PARAM NAME=DataSource datasrc=#adc></object>

    One of the PARAMs should be DataField0, in this sample, we will set the field for simplicity. Modify the line that reads:

    <PARAM NAME="DataField0" VALUE="">

    To read:

    <PARAM NAME="DataField0" VALUE="ProductCode">


    NOTE: If you want to set the DataField0 at run-time, you could do that in the OnLoad routine as follows:

    ...

    Server.Value = "http://<%=Request.ServerVariables("SERVER_NAME")%>"

    Connect.Value = "DSN=AdvWorks"

    SQL.Value = "Select * from Products"

    PVTreeViewX1.DataField(0) = "ProductCode"

    ...

  10. Save the file (it should update your Web on the server) and view it in your browser. When the page comes up, click on Run.