I'm having a problem with a WPF C# .NEt 4.5 application.
I'm programmatically creating a DataGridHyperlinkColumn inside a Grid.
Meaning that almost nothing is written in the xaml file but created directly by the .cs
What I'm trying to achieve is the following:
<DataGridHyperlinkColumn Header="Path" Binding="{Binding Path=FullPath}" ContentBinding="{Binding Path=Name}" IsReadOnly="True" Width="*">
<DataGridHyperlinkColumn.ElementStyle>
<Style>
<EventSetter Event="Hyperlink.Click" Handler="hyperlink_Click"/>
</Style>
</DataGridHyperlinkColumn.ElementStyle>
</DataGridHyperlinkColumn>
With this code I'm able to populate my Grid with links, which when clicked will activate my hyperlink_Click function.
Now if I'll do this by code the result is the following:
DataGridHyperlinkColumn parent = new DataGridHyperlinkColumn
{
Binding = new Binding("ParentName"),
};
But now I'm not able to attach a new RequestNavigateEventHandler(hyperlink_Click) to each link which will populate my Grid.
At the current time my grid is populate with links, that are not possibile to be clicked.
Thanks for any suggestions!