Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing WPFToolKit's DataGridHyperlinkColumn
    primarykey
    data
    text
    <p>I'm using WPFToolkit's Datagrid control. I can populate the datagrid, but I'm having trouble with the DataGridHyperlinkColumn. I would like it to visually display the link as the Person's name, but for the link to go to whatever UriLink's value is.</p> <p>How can I do this? What am I doing wrong? </p> <p>Xaml:</p> <pre><code>&lt;dg:DataGridHyperlinkColumn Header="Person Name" Width="200" Binding="{Binding Path=PersonName}" IsReadOnly="True" TargetName="{Binding Path=UriLink}"&gt;&lt;/dg:DataGridHyperlinkColumn&gt; </code></pre> <p>Alternatively, I would rather put an event handler in instead, and create the page object to navigate to, but I can't seem to pull any data out of the event's two parameters (o and e in this case), where obj1/obj2 are objects/variables of the clicked hyperlink's row.</p> <p>Alternative Xaml:</p> <pre><code>&lt;dg:DataGridHyperlinkColumn Header="Person Name" Width="200" Binding="{Binding Path=PersonName}" IsReadOnly="True" TargetName="{Binding Path=UriLink}"&gt; &lt;dg:DataGridHyperlinkColumn.ElementStyle&gt; &lt;Style TargetType="TextBlock"&gt; &lt;EventSetter Event="Hyperlink.Click" Handler="OnHyperlinkClick" /&gt; &lt;/Style&gt; &lt;/dg:DataGridHyperlinkColumn.ElementStyle&gt; &lt;/dg:DataGridHyperlinkColumn&gt; </code></pre> <p>VB code (for Alternative Xaml):</p> <pre><code>Private Sub OnHyperlinkClick(ByVal o As Object, ByVal e As RoutedEventArgs) 'TODO: Create page to navigate to Dim page As New RedirectPage(obj1, obj2) Me.NavigationService.Navigate(page) End Sub </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload