System.Web.UI.WebControls Namespace
Renders a column in a DataGrid that contains a hyperlink for each item in the column.
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.
The following example demonstrates using a HyperLinkColumn in a DataGrid to provide data-bound links to a product details page.
Show me
DataGrid BoundColumn ButtonColumn EditCommandColumn TemplateColumn