The requested page is not available for the requested platform. You are viewing the content for Default platform.

Hyperlink Column

  • 3 min to read

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

GridHyperLinkColumn_Example_Win

You can provide hyperlinks as a separate data column. or they can be automatically created at run-time 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.

GridHyperLinkColumn_UnderlyingDataSource

The following sections describe how to create hyperlink columns in more 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 dimension. Drag and drop The GDP data field to another column's data item container. The data field is recognized as measure and summarized.

GridHyperLinkColumn_InitialGrid

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

GridHyperLinkColumn_HyperlinkAsText

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

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

GridHyperLinkColumn_HyperlinkAsLink

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.

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.

GridHyperLinkColumn_HyperlinkWithDisplayText

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 dimension. Drag and drop the GDP data field to another column's data item container. The data field is recognized as measure and summarized.

GridHyperLinkColumn_InitialGrid

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}

GridHyperLinkColumn_ColumnOptionsDialog

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 picture.

GridHyperLinkColumn_UriPatternLink

The hyperlink column supports relative and absolute URI patterns:

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

Relative pattern

Generates relative links to the current site (server name + URI pattern).

?Country={0}

http://localserver/dashboard/?Country=France

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