HOWTO: Enable Single-Click Row Selection in the VI 6.0 Grid DTC

ID: Q198827


The information in this article applies to:


SUMMARY

The Visual InterDev 6.0 Grid Design-Time Control (DTC) provides a navigation bar that enables the user to page through the displayed records when bound to a Recordset Design-Time Control. This article will describe how to set up single-click navigation to a particular row; that is, a user clicks on a row, and the Grid DTC immediately navigates to the selected row.


MORE INFORMATION

Before you begin, you must have a Grid DTC bound to a Recordset DTC on your page. You must also know the "Scripting platform" of your Recordset DTC (the Grid DTC will inherit the Scripting platform of the Recordset DTC it is bound to), Client (Internet Explorer 4.0 DHTML) or Server.

To determine the Scripting platform of the Recordset DTC, right-click the Recordset DTC and select Properties. On the Implementation tab you will see a field for Scripting platform. If the field says Inherit from page, you may either set the Scripting platform in the page properties, or override it by setting it in the Recordset DTC properties.

For both Client and Server Scripting platforms, you must first enable Row Navigation in the properties of the Grid DTC. To enable row navigation, follow these steps:

  1. Right-click the Grid DTC and select Properties.


  2. Select the Navigation tab.


  3. Check Enable row navigation and select a Row color.


  4. Click OK to apply the changes and close the dialog box.


For a Client Scripting platform, enabling row navigation is all that is needed. Dynamic HTML (DHTML) will detect which row is clicked by the user and navigate to that row. Since DHTML is not available for a Server Scripting platform, you will use the Grid DTC's anchor() method to create a hyper-link that will navigate to the selected row. To set up a hyper-link with the anchor() method, follow these steps:
  1. Right-click the Grid DTC and select Properties.


  2. Select the Data tab.


  3. In the Grid columns section, choose a column (or columns) that you want to set up as the hyper-link to that row.


  4. Click on the selected column in the Grid columns section.


  5. Make note of the value in the Field/expression field. By default, this is the column name, but it could also be an expression such as:
    
    ="<b>$" + [ColumnName] + "</b>" 

    If only the column name shows, replace the column name with the following expression where "GridName" is the name of the Grid DTC and "ColumnName" is the name of the column (or field) of the recordset:
    
    =GridName.anchor([ColumnName]) 

    If there is an expression instead of the column name, then surround the expression (to the right of the equal sign "=") with the anchor() method as in the following:

    
    =GridName.anchor("<b>" + [ColumnName] + "</b>") 

    IMPORTANT: The Grid DTC uses JavaScript to evaluate this field, so all entries are case sensitive.


  6. Click OK and save your changes. If you would like to set up multiple columns to navigate to the selected row, repeat the previous steps for each column.


Additional query words: kbDSupport


Keywords          : kbCtrl kbVisID kbVisID600 kbGrpASP 
Version           : WINDOWS:6.0
Platform          : WINDOWS 
Issue type        : kbhowto 

Last Reviewed: May 4, 1999