0

wpf で GridViewHyperLinkColumn の NavigateURL プロパティを使用する方法は?

質問: 私のデータガードには GridViewHyperLinkColumn の列があり、グリッド内の GridViewHyperLinkColumn のデータをクリックすると、別の xaml (SetPassword.xaml と言う) ファイルのポップアップ画面を取得する必要があります。データグリッドの GridViewHyperLinkColumn データをクリックしたときにポップアップ画面を取得する方法は? GridViewHyperLinkColumnデータをクリックするとポップアップが表示されるように、どのプロパティにURLを割り当てる必要がありますか?

ありがとう、スーチャイ

4

1 に答える 1

1

I assume you mean DataGridHyperlinkColumn since there is no built in GridViewHyperLinkColumn. That column type is designed only for uri based navigation, which you could use if you had a WPF navigation application and wanted it to jump to a different page, for example. Since you want a completely different behavior of opening a new window you'll need to do that from code, which means using a different mechanism. Using a template column you can add in a Hyperlink that can have either a Click event handler or a bound Command (if using MVVM). Here's an example using Click:

<DataGridTemplateColumn IsReadOnly="True">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <TextBlock>
                <Hyperlink Click="Hyperlink_Click_1">
                    <TextBlock Text="{Binding Path=SomePropertyForThisColumn}"/>
                </Hyperlink>
            </TextBlock>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
于 2013-02-06T13:47:31.677 に答える