GridViewHyperlinkColumn

5 posts, 0 answers
  1. Maya
    Maya avatar
    4 posts
    Member since:
    Apr 2016

    Posted 18 Apr Link to this post

    Hello, 
    How can I set foreground property for cells of GridViewHyperlinkColumn in xaml ?
    Thank you in advance,
    Maya
  2. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 18 Apr Link to this post

    Hello Maya,

    GridViewHyperlinkColumn creates a regular Hyperlink element for its content, so you can use the following style:
    <Style TargetType="Hyperlink">
                <Setter Property="Foreground" Value="Red"/>
            </Style>


    Regards,
    Yoan
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  3. UI for WPF is Visual Studio 2017 Ready
  4. Maya
    Maya avatar
    4 posts
    Member since:
    Apr 2016

    Posted 20 Apr in reply to Yoan Link to this post

    Hello,

    unfortunately it didn't work for me. Below is the relevant snippet from xaml:

    <telerik:GridViewHyperlinkColumn  DataMemberBinding="{Binding LibraryPath}">

    <telerik:GridViewHyperlinkColumn.Header>

    <Label x:Uid="Label_Path" Content="Path" Foreground="White" />

    </telerik:GridViewHyperlinkColumn.Header>

    <Style TargetType="Hyperlink">
                <Setter Property="Foreground" Value="Red"/>
            </Style>

    </telerik:GridViewHyperlinkColumn>

    Error: The type GridViewHyperlinkColumn does not support direct content

  5. Yoan
    Admin
    Yoan avatar
    1070 posts

    Posted 20 Apr Link to this post

    Hello,

    Indeed, GridViewHyperlinkColumn does not support direct content. You can define the style within the Window resources. Please check this help article for a reference.

    Regards,
    Yoan
    Telerik
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
  6. Maya
    Maya avatar
    4 posts
    Member since:
    Apr 2016

    Posted 21 Apr in reply to Yoan Link to this post

    Thank you very much. The article helped me to solve the problem
Back to Top
UI for WPF is Visual Studio 2017 Ready