Hyperlink Column

GridViewHyperlinkColumn derives from GridViewBoundColumnBase class and its content is represented by a HyperlinkButton control. The bound value is automatically displayed as a link.

Here is a list of the most important properties.

  • DataMemberBinding - you can specify the property of the business object to be displayed as value in the cell. It is automatically displayed as a link.

  • TargetName - specifies the location to open the link.

Lets say the bound data object exposes a TeamUrl property defined as follows:

public class Employee : ObservableObject 
{ 
    private string teamUrl = "http://google.com"; 
    public string TeamUrl 
    { 
        get { return this.teamUrl; } 
        set 
        { 
            if (value != this.teamUrl) 
            { 
                this.teamUrl = value; 
                this.OnPropertyChanged("TeamUrl"); 
            } 
        } 
    } 
} 
Public Class Employee 
    Inherits ObservableObject 
    Private m_teamUrl As String = "http://google.com" 
    Public Property TeamUrl() As String 
        Get 
            Return Me.m_teamUrl 
        End Get 
        Set(value As String) 
            If value <> Me.m_teamUrl Then 
                Me.m_teamUrl = value 
                Me.OnPropertyChanged("TeamUrl") 
            End If 
        End Set 
    End Property 
End Class 

Then, here is how to define a column of such a type.

Example 1: Define GridViewHyperlinkColumn in XAML.

<telerik:RadGridView x:Name="radGridView" 
                 AutoGenerateColumns="False"> 
    <telerik:RadGridView.Columns> 
        <telerik:GridViewHyperlinkColumn Header="Team Url" 
                     DataMemberBinding="{Binding TeamUrl}"> 
        </telerik:GridViewHyperlinkColumn> 
    </telerik:RadGridView.Columns> 
</telerik:RadGridView> 

See also

In this article
Not finding the help you need? Improve this article