The output above example is shown below:

The DataGrid in above example is bound to the Employees database table.
The values from the Employees FirstName column are displayed by the BoundColumn, and links to a page with detailed author information are displayed by the HyperLinkColumn.
Each hyperlink displayed by the HyperLinkColumn is displayed with the help of the DataNavigateUrlField, DataNavigateUrlFormatString, and Text properties. The DataNavigateUrlField and DataNavigateUrlFormatString properties create tile URL for the link. In this case, the links point to a page named EmpDetails. aspx. The EmployeeID column is passed to EmpDetails. aspx in a query string variable named ID.
The Text property specifies the label for the link. In above example, each link is simply labelled with the text view of complete details.
Following is a list of some of the important properties of a Hype rLinkColumn:
DataNavigateUrlField
A field from the DataGrid control's data source for creating the URL of the hyperlink
DataNavigateUrlFormatString
A format string that formats the value of the DataNavigateUrlField
DataTextField
A field from the DataGrid control's data source used for the label of the hyperlink
HeaderrmageUrl
Image that is displayed at the top of the HyperLinkColumn
DataTextFormatString
A format string that formats the value of the DataTextField
FooterText
Text displayed at the bottom of the HyperLinkColumn
HeaderText
Text displayed at the top of the HyperLinkColumn
NavigateUrl
The URL of the hyperlink
Text
Text displayed as the label of the hyperlink
Target
The window or frame that the hyperlink targets
|