I am wondering if it is an easy task. I need to have some of the text inside the datagrid to be hyperlinks. I generated content with XMLDataProvider. Any ideas are highly appreciated.
My DataGrid looks below. I am working with WPF toolkit:
<DataGrid x:Name="MainGrid" GridLinesVisibility="Horizontal" AutoGenerateColumns="False" RowHeight="20" ItemsSource="{Binding XPath=/ServicesTiles/Servers}"
HeadersVisibility="None" Margin="10,15,0,0"
HorizontalGridLinesBrush="{x:Null}"
BorderBrush="{x:Null}"
VerticalGridLinesBrush="{x:Null}"
Background="{x:Null}"
RowBackground="{x:Null}"
CellStyle="{DynamicResource DataGridCellStyle1}"
HorizontalAlignment="Left">
<DataGrid.Columns>
<DataGridTextColumn Binding="{Binding XPath=@Name}" Foreground="#FF6E6E6E" MinWidth="160" />
<DataGridTextColumn Binding="{Binding XPath=@Status}" Foreground="#FF6E6E6E" MinWidth="270"/>
<DataGridTextColumn Binding="{Binding XPath=@Name2}" Foreground="#FF6E6E6E" MinWidth="220"/>
<DataGridTextColumn Binding="{Binding XPath=@Status2}" Foreground="#FF6E6E6E" MinWidth="220"/>
</DataGrid.Columns>
</DataGrid>
Make use of the
Commandon theHyperlink. If you want to call back into theDataContextof theDataGridyou will need to make use ofFindAncestorand search for typeDataGrid.