title: Modify text in column cells and make it hyperlink, listView WPF C#
body: <p>For now I am displaying in one of the columns in listView, GridView one of the property of my class. This looks more or less:</p>
  
  <pre><code>    &lt;ListView x:Name="offers_listView"  Margin="38,185,35,81" &gt;
          &lt;ListView.View&gt;
              &lt;GridView&gt;
                  &lt;GridViewColumn Width="100" Header="itemId" DisplayMemberBinding="{Binding Path=itemId}" /&gt;
  </code></pre>
  
  <p>ItemID is a number. </p>
  
  <p>What I would like to do is make a hyperlink based on this number. For example from ItemId equals to 1234 I would like to make clickable link to address www.website.com/showItem.php?itemId=1234. The best solution would be if the column still display 1234 but it is clickable link to the address I mentioned. Of course for the whole list, each item have different itemID property.</p>
  
  <p>May anyone give me a hint how to do it or sample of code I can based ?</p>
  
  <p><strong>edit:</strong></p>
  
  <p>Solution gave below have been adapted by me.</p>
  
  <p>However on the logic side NavigateUri have been null, so the link opened in browser have been not correct. I have adapt this idea directly to textblock as I paste my code below:</p>
  
  <pre><code>                &lt;GridViewColumn Width="100" Header="itemLink"&gt;
                      &lt;GridViewColumn.CellTemplate&gt;
                          &lt;DataTemplate&gt;
                              &lt;TextBlock Text="{Binding Path=itemId}" MouseDown="TextBlock_MouseDown"/&gt;
                          &lt;/DataTemplate&gt;
                      &lt;/GridViewColumn.CellTemplate&gt;
                  &lt;/GridViewColumn&gt;
  
      private void TextBlock_MouseDown(object sender, MouseButtonEventArgs e)
      {
          var urlPart2 = ((TextBlock)sender).Text;
          //var urlPart = ((Hyperlink)sender).NavigateUri;
          var fullUrl = string.Format("http://allegro.pl/show_item.php?item={0}", urlPart2);
          Process.Start(new ProcessStartInfo(fullUrl));
          e.Handled = true;
      }
  </code></pre>