Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7180497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T17:21:40+00:00 2026-05-28T17:21:40+00:00

I have a DataGrid in my WPF window which is bound to a database.

  • 0

I have a DataGrid in my WPF window which is bound to a database. Database fields are Link, Title, SavedOn which have types nvarchar, nvarchar and DateTime respectively. At present all the feilds are bound to different columns in DataGrid. I am using DataGridHyperLinkColumn for Link column and Event Setter to capture Hyperlink.Click events. All is working fine.

PROBLEM:

But now i want to make it such a way that Text in Title Column of datagrid links to the Link that is when clicked takes me to the Link.Using this approach i’ll save one column as both title and clickable link is in one column just as in normal webpages.Any ideas how can i go about this?. Currently grid looks like this:
enter image description here

Plus, how can i change the default royal blue color of links to something else?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T17:21:41+00:00Added an answer on May 28, 2026 at 5:21 pm

    Use the ContentBinding to specify the display text for the link (just get rid of the Title column).

    To display hyperlink text that is different than the URI string, use the ContentBinding property.

    To style the hyperlinks in the whole grid add a style to the DataGrid.Resources:

    <DataGrid.Resources>
        <Style TargetType="Hyperlink">
            <Setter Property="Foreground" Value="Green" />
            <Style.Triggers>
                <Trigger Property="IsMouseOver" Value="true">
                    <Setter Property="Foreground" Value="Lime" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </DataGrid.Resources>
    

    …to apply it only in one column assign it as the ElementStyle of the column, you will need to nest it in a TextBlock style though.

    <DataGridHyperlinkColumn.ElementStyle>
        <Style TargetType="TextBlock">
            <Style.Resources>
                <Style TargetType="Hyperlink">
                    <!-- ... -->
                </Style>
            </Style.Resources>
        </Style>
    </DataGridHyperlinkColumn.ElementStyle>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have WPF DataGrid placed on the Window . I have a button which
In my application i have a WPF Window that has a DataGrid in it.
I have a wpf window which is used to add as well as edit
I have a WPF window that contains a DataGrid at the bottom half of
I'm experimenting with databinding in WPF I have this datagrid that is bound to
I have a WPF DataGrid which has an AlternatingRowBackground brush. It's configured to color
I have a WPF application which uses a (currently) local database to act as
I have a problem with my WPF application. I have a datagrid (Wpf Toolkit),
I have a DataGrid in WPF app with several columns, including a Name column.
I have a strange problem with a WPF DataGrid from WPF Toolkit. The scrollbars

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.