Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1025
Is it possible to add a hyperlink to a value in a cell?
posted

I would like to add a hyperlink to a column's value so that I can navigate to another function in my app. Is this possible?

 Thanks,Rod

Parents Reply Children
  • 100
    posted in reply to Richard

    You can use the CellValuePresenter to easily add a hyperlink to a cell

    http://help.infragistics.com/Help/NetAdvantage/WPF/2007.1/CLR3.X/HTML/Infragistics3.Windows.DataPresenter.v7.1~Infragistics.Windows.DataPresenter.FieldSettings~CellValuePresenterStyle.html

            <!-- hyperlink cell -->
            
    <!-- Note - you'll need to handle the routed Hyperlink.RequestNavigate to process the clicking on a link -->
            
    <Style TargetType="{x:Type igDP:CellValuePresenter}" x:Key="hyperlinkCell">
                
    <Setter Property="Template">
                    
    <Setter.Value>
                        
    <ControlTemplate TargetType="{x:Type igDP:CellValuePresenter}">
                            
    <TextBlock Margin="{TemplateBinding Padding}">
                                
    <Hyperlink NavigateUri="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}">
                                    
    <TextBlock Text="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Value}"/>
                                
    </Hyperlink>
                            
    </TextBlock>
                        
    </ControlTemplate>
                    
    </Setter.Value>
                
    </Setter>
            
    </Style>