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 5981287
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:55:23+00:00 2026-05-22T21:55:23+00:00

I have a column in a gridview that has a hyperlink defined in each

  • 0

I have a column in a gridview that has a hyperlink defined in each row.

<TextBlock>
    <Hyperlink Click="btn_Authorise">
        <TextBlock Text="{Binding LinkText}"/>
    </Hyperlink>
</TextBlock>

I would like the hyperlink to execute different code depending on some parameters I bind to it. ie. the user clicks the link and in the code behind it looks at a parameter and opens one of four dialog windows. How can I add a parameter? Should I be using Commands?

I an new to WPF.

EDIT:

Ok – So all I needed to do was add the CommandParameter=”” and I could then handle the rest in the event handler. This is probably not the correct usage of ‘Commanding’.

<TextBlock>
    <Hyperlink Click="btn_Authorise" CommandParameter="{Binding ActionProperty}">
        <TextBlock Text="{Binding LinkText}"/>
    </Hyperlink>
</TextBlock>
  • 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-22T21:55:24+00:00Added an answer on May 22, 2026 at 9:55 pm

    Edit: So apparently Hyperlinks also have commanding, which makes this quite straightforward.

    See the commanding overview if you are new to commands in WPF.


    You could wrap it in a lookless Button and only handle the Button.Click, then you can bind a Command to it and utilize the CommandParameter.

    To make a button lookless you can change the Template:

    <Button.Template>
        <ControlTemplate>
            <ContentPresenter />
        </ControlTemplate>
    </Button.Template>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a gridview that has a column that currently returns a 1 if
I currently have a gridview that has an asp:ButtonField as one of the columns.
I have an ASP.NET GridView which has columns that look like this: | Foo
I have a GridView that allows editing the values in every column, in every
I have a gridview that I have added a checkbox column using a templatefield
I have an gridview that I am adding onclick events to a checkbox column
I have used checkbox column in gridview. I want to check status of that
T have used checkbox column in gridview. On click of a linkbutton, it should
I have a user control that contains a GridView. The GridView has both a
Lets say I have a table that has a bit column named Active .

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.