Skip to main content

Hyperlink Column

  • 3 minutes to read

A hyperlink column allows you to display hyperlinks in the Grid dashboard item.

WinForms Dashboard Designer - Hyperlink Column

You can display hyperlinks in a separate data column, or they can automatically be created at runtime from any column using the specified URI pattern.

In this document, the sample data source contains four fields: country name, official country name, Wikipedia country page’s URI and the GDP value.

WinForms Dashboard Designer - Underlying Data Source

The following sections describe how to create hyperlink columns in greater detail:

Data Field Containing Uri Values

Drag the Name data field from the Data Source tree view to the column’s data item container. The data field is automatically processed as a dimension. Drag and drop the GDP data field to another column’s data item container. The data field is recognized as a measure and summarized.

WinForms Dashboard Designer - Initial Grid

Drop the Link field between the Name and the GDP (Sum) data items. The Grid recognizes this field as a dimension and displays links as plain text.

WinForms Dashboard Designer - Hyperlink as Text

Click the Column Type Indicator button next to the Name data item and change its type to Hyperlink.

WinForms Dashboard Designer - Hyperlink Column Options

The Grid displays column values as clickable hyperlinks allowing you to navigate to the Wiki’s pages.

WinForms Dashboard Designer - Hyperlink as Link

You can bind the Display value and URI value to different data fields. Click the New Column data item placeholder and change its type to Hyperlink.

WinForms Dashboard Designer - Hyperlink Column

Drag and drop the OfficialName field to the Display Value data item placeholder to display official country names. Drag and drop the Link field to the Uri data item placeholder to specify URIs.

The grid displays official country names with links obtained from the Link data source field.

WinForms Dashboard Designer - Hyperlink with Display Text

Uri Pattern

In this case, a specified URI pattern is used to generate links.

Drag the Name data field from the Data Source tree view to the column’s data item container. The data field is automatically processed as a dimension. Drag and drop the GDP data field to another column’s data item container. The data field is recognized as a measure and summarized.

WinForms Dashboard Designer - Initial Grid

Click the Column Type Indicator button next to the Name data item and change its type to Hyperlink. Specify the URI Pattern option as follows:

https://en.wikipedia.org/wiki/{0}

WinForms Dashboard Designer - Column Options Dialog

The {0} placeholder is replaced with the Name data item value. The links are generated for country names and displayed in the grid as illustrated in the following image:

WinForms Dashboard Designer - URI Pattern Link

The hyperlink column supports an absolute URI pattern:

URI Pattern

Description

Example

Link Result

Absolute pattern

Generates absolute links to the specified site.

https://en.wikipedia.org/wiki/{0}

https://en.wikipedia.org/wiki/France

URL Validation

DevExpress BI Dashboard automatically validates all URLs in hyperlink columns to protect against security threats such as XSS, SSRF, and phishing attacks.

Only the following URI schemes are allowed:

  • http
  • https
  • mailto

Unsafe schemes such as javascript:, file:, data:, and others are blocked and rendered as plain text.

For additional information on URL validation rules and how to customize validation logic, refer to the following topic: Safe URL Validation.

Example

The following code snippet creates the Hyperlink column:

var grid = new GridDashboardItem();
grid.DataSource = dataSource;

var gridHyperlink = new GridHyperlinkColumn();
gridHyperlink.UriDataMember = "Product";
gridHyperlink.DisplayValue = new Dimension("Product");
gridHyperlink.UriPattern = "https://www.google.com/search?q={0}";

grid.Columns.Add(gridHyperlink);
See Also