0

I have a WPF datagrid which has one column of type DataGridTemplateColumn and I want to change data template to add a hyperlinkbutton in order to hide cell value depending on a condition:

The problem is that HyperlinkButton in .NET 3.5 SP1 does not exist. So how to do a link button in .NET 3.5? Maybe using this solution by changing button style? Or is there any other better solution in .NET 3.5?

Willy
  • 9,848
  • 22
  • 141
  • 284
  • You mean something like this ``? – XAMlMAX Nov 28 '18 at 18:37
  • @XAMlMAX not exactly. I am trying to do something like this: https://social.msdn.microsoft.com/Forums/Azure/en-US/e7858f73-9c56-406b-8e67-3a9ef7979a94/hide-datagrid-cell-value-template-column?forum=silverlightmvvm See the solution proposed there. My problem is that does not exist in NET Framework 3.5.... – Willy Nov 28 '18 at 21:09
  • 1
    Is hyperlinkbutton neccessary? You could just define a `HyperLink` as a `DataTemplate`. If you want to change how things look in WPF you would define a template for it. WPF is very flexible in that respect. – XAMlMAX Nov 28 '18 at 22:50
  • Finally I have used a TextBlock object and within It I have placed an Hyperlink object as It is explained by Matej in the following link.It's the simplest solution and no need to implement button styles: https://stackoverflow.com/questions/5122334/how-do-i-make-a-wpf-button-look-like-a-link – Willy Nov 29 '18 at 19:23
  • Regarding HyperlinkButton It is available in Silverlight. I did not find the way to use It in desktop WPF applications, not sure if It is possible to use in wpf apps by importing some kind of namespace.If anyone knows, share knowledge. – Willy Nov 29 '18 at 19:27

0 Answers0