asp.net.ph

HyperLinkColumn Class

System.Web.UI.WebControls Namespace


Renders a column in a DataGrid that contains a hyperlink for each item in the column.

HyperLinkColumn Class Members

Collapse   Constructors

Visibility Constructor Parameters
public HyperLinkColumn ( )

Collapse   Properties

Visibility Name Value Type Accessibility
public DataNavigateUrlField String [ Get , Set ]
public DataNavigateUrlFormatString String [ Get , Set ]
public DataTextField String [ Get , Set ]
public DataTextFormatString String [ Get , Set ]
public NavigateUrl String [ Get , Set ]
public Target String [ Get , Set ]
public Text String [ Get , Set ]

Collapse   Methods

Visibility Name Parameters Return Type
protected FormatDataNavigateUrlValue ( Object dataUrlValue ) String
protected FormatDataTextValue ( Object dataTextValue ) String
public Initialize ( ) Void
public InitializeCell ( TableCell cell , Int32 columnIndex , ListItemType itemType ) Void

Remarks

Use the HyperLinkColumn to create a hyperlink for each row in a DataGrid control. To specify the caption for the hyperlink, set the Text property. To specify the URL to navigate to when the hyperlink is clicked, set the NavigateUrl property.

NOTE: If you set the Text and NavigateUrl properties, all hyperlinks in the column will share the same caption and URL.

You can also bind the text caption and URL of the hyperlinks in the column column to a field in a data source instead of setting the Text and NavigateUrl properties. This allows you to display a different caption and have a separate URL for each hyperlink in the column.

Use the DataTextField property to specify a field in a data source to bind to the text caption of the hyperlinks in the column.

NOTE: The DataTextField and Text properties cannot both be set at the same time. If both properties are set, the DataTextField property takes precedence.

Specify the field to bind to the URL of the hyperlink by setting the DataNavigateUrlField property.

NOTE: The DataNavigateUrlField and NavigateUrl properties cannot both be set at the same time. If both properties are set, the DataNavigateUrlField property takes precedence.

When using data binding, you can format the text caption and URL of the hyperlink by setting the DataTextFormatString and DataNavigateUrlFormatString property, respectively.

The Target property allows you to specify the window or frame to display the Web page content linked to when the hyperlink is clicked.

Example

The following example demonstrates using a HyperLinkColumn in a DataGrid to provide data-bound links to a product details page.

 Show me 

See Also

DataGrid   BoundColumn   ButtonColumn   EditCommandColumn   TemplateColumn Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph