0
我有一個模板列數據網格與超鏈接作爲模板超鏈接在數據網格WPF從停止行被選擇
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock>
<Hyperlink Command="{Binding Path=OpenCommand}">
<TextBlock Text="{Binding Path=Description}" />
</Hyperlink>
</TextBlock>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
數據網格也有與所選擇的行的命令一個ContextMenu。當用戶右鍵單擊超鏈接列以外的任何其他列的行時,該行將被選中並顯示上下文菜單。我遇到的問題是,當用戶右鍵單擊超鏈接時,爲了查看該行的命令,該行不會自動被選中。
問題:如何讓超鏈接忽略鼠標右鍵單擊,並讓datagrid負責該事件並像在其他列中一樣選擇行?
我沒有用你建議的精確解,但你肯定給我提供了正確的方向。謝謝一堆。 – ThomasAndersson