NoWar
NoWar

Reputation: 37632

Hyperlink within GridViewColumn.CellTemplate issue

How I can adjust WPF Hyperlink within GridViewColumn.CellTemplate?

enter image description here


Special thanks to @H.B. !!

Here is the solution

<GridViewColumn   Width="Auto" Header="URL" >
    <GridViewColumn.CellTemplate>
        <DataTemplate>                                   
            <TextBlock  Name="urlToContent" MinWidth="100" Width="Auto">
                <Hyperlink NavigateUri="{Binding Path=URL}" Name="hlkURL"   RequestNavigate="OpenPageRequestNavigate">
                     <TextBlock Text="{Binding Path=URL}"/>  
                </Hyperlink>
             </TextBlock>
         </DataTemplate>
    </GridViewColumn.CellTemplate> </GridViewColumn

Upvotes: 0

Views: 2113

Answers (2)

MyKuLLSKI
MyKuLLSKI

Reputation: 5325

As @H.B. says you have to use a TextBlock.

However, you can use a RichTextBox

Upvotes: 0

brunnerh
brunnerh

Reputation: 185140

TextBoxes do not support flow content, use a TextBlock.

Upvotes: 1

Related Questions