Skip to main content

GridHyperlinkColumn.UriPattern Property

Gets or sets a common URI part used to generate links for the hyperlink column.

Namespace: DevExpress.DashboardCommon

Assembly: DevExpress.Dashboard.v24.2.Core.dll

Declaration

[DefaultValue("")]
public string UriPattern { get; set; }

Property Value

Type Default Description
String String.Empty

A String value that specifies a common URI part used to generate links for the hyperlink column.

Example

This example demonstrates how to create two Grid dashboard item’s hyperlink columns in code. The first column obtains hyperlinks from the field in the underlying data source while the second column generates hyperlinks from country names using the specified URI pattern.

View Example: WinForms Designer - How to create the Grid's hyperlink column in code

using DevExpress.DashboardCommon;
using DevExpress.DataAccess.Excel;

namespace Dashboard_GridHyperlinkColumn
{
    public partial class Form1 : DevExpress.XtraBars.Ribbon.RibbonForm
    {
        public Form1()
        {
            InitializeComponent();
            dashboardDesigner1.CreateRibbon();

            Dashboard dashboard = new Dashboard();

            DashboardExcelDataSource excelDataSource = new DashboardExcelDataSource("Excel Data Source");
            excelDataSource.FileName = @"..\..\Data\GDPByCountry.xlsx";
            excelDataSource.SourceOptions = new ExcelSourceOptions(new ExcelWorksheetSettings("Sheet1"));
            dashboard.DataSources.Add(excelDataSource);

            GridDashboardItem grid = new GridDashboardItem();
            grid.DataSource = excelDataSource;

            // Creates two hyperlink columns: the first column takes hyperlinks from the underlying data source while the second 
            // generates links based on the specified URI pattern and data source country names.
            GridHyperlinkColumn hyperlinkColumn1 = new GridHyperlinkColumn(new Dimension("Uri"), new Dimension("OfficialName"));
            GridHyperlinkColumn hyperlinkColumn2 = new GridHyperlinkColumn(new Dimension("Name"), new Dimension("OfficialName"));
            hyperlinkColumn2.UriPattern = "https://en.wikipedia.org/wiki/{0}";

            GridMeasureColumn gdpColumn = new GridMeasureColumn(new Measure("GDP"));
            grid.Columns.AddRange(hyperlinkColumn1, hyperlinkColumn2, gdpColumn);
            dashboard.Items.Add(grid);
            dashboardDesigner1.Dashboard = dashboard;
        }
    }
}

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the UriPattern property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also