2

Is it possible to pass a whole row as a parameter for the Hyperlink of DataGridTemplateColumn?

<my:DataGridTemplateColumn Header="Name">
  <my:DataGridTemplateColumn.CellTemplate>
    <DataTemplate>
      <TextBlock>
        <Hyperlink Foreground="Black" TextDecorations="None">
          <Run Text="{Binding Name}" />
        </Hyperlink>
      </TextBlock>
    </DataTemplate>
  </my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>
wipindipy10
  • 150
  • 1
  • 1
  • 8

1 Answers1

0

Hard to tell what you are trying to achieve but a ComandParameter binding without a value should give you the row eg

<Hyperlink Foreground="Black" TextDecorations="None" CommandParameter="{Binding}" Command="{Binding methodThatHandlesTheHyperlinkClick}"> 
      <Run Text="{Binding Name}" /> 
</Hyperlink>
Nogusta
  • 909
  • 5
  • 10
  • 1
    Noticed, you are new to Stack Overflow. It works well when you mark the answer as accepted rather than just a comment (assuming the answer was what you were afer of course) see http://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work – Nogusta Jul 03 '12 at 06:48