Microsoft KB Archive/198827

= How To Enable Single-Click Row Selection in the VI 6.0 Grid DTC =

Article ID: 198827

Article Last Modified on 7/1/2004

-

APPLIES TO


 * Microsoft Visual InterDev 6.0 Standard Edition

-



This article was previously published under Q198827



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:  Right-click the Grid DTC and select Properties. Select the Data tab. In the Grid columns section, choose a column (or columns) that you want to set up as the hyper-link to that row. Click on the selected column in the Grid columns section.  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:

="$" + [ColumnName] + ""

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("" + [ColumnName] + "")

IMPORTANT: The Grid DTC uses JavaScript to evaluate this field, so all entries are case sensitive.  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.</ol>

Keywords: kbhowto kbctrl KB198827

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.