0
我正在編寫一個WPF應用程序,並在一個用戶控件中使用DataGrid中的超鏈接,但它不起作用。我正在使用bing.com來測試。DataGrid中的超鏈接不起作用
<DataGrid Grid.Row="1"
AutoGenerateColumns="False"
Height="Auto"
Name="dataGrid1"
Width="Auto"
CanUserAddRows="False"
CanUserResizeColumns="True"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Focusable="True"
IsHitTestVisible="False"
BorderThickness="0">
<DataGrid.Columns >
<DataGridTextColumn Header="Start Time" Width="*" Binding="{Binding Path=startTime}" CanUserSort="True"/>
<DataGridTextColumn Header="End Time" Width="*" Binding="{Binding Path=endTime}" CanUserSort="True"/>
<DataGridTextColumn Header="Resources" Width="*" Binding="{Binding Path=resources}" CanUserSort="True"/>
<DataGridTextColumn Header="Action" Width="*" Binding="{Binding Path=action}" CanUserSort="True"/>
<DataGridTextColumn Header="Result" Width="*" Binding="{Binding Path=result}" CanUserSort="True"/>
<DataGridTemplateColumn Header="Health" Width="*" CanUserSort="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock >
<Hyperlink NavigateUri="http://www.bing.com" RequestNavigate="Hyperlink_RequestNavigate"><!--"{Binding Path=healthUri}">-->
<TextBlock Text="{Binding Path=healthUri}" Focusable="True" />
</Hyperlink>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
爲什麼不直接使用[DataGridHyperlinkColumn(http://msdn.microsoft.com/en-us/library/system.windows.controls.datagridhyperlinkcolumn.aspx)? – Filburt