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
124
How do you sort a HyperLinkColumn
posted

I've  got a grid of documents with a link column and just want to display the file names of the URI.

The sorting is using the URI (which feels wrong) and so added my own Comparer but the compare isn't being use. I've looked at the HyperlinkColumn and seen that the SortComparer is set to an internal UriComparer if the datatype is Uri. Shouldn't my Xaml win? It looks like I might have to bind to a string instead? Should the sorting be on the content or the data? Should I reset the sort comparer in code?

<igGrid:HyperlinkColumn
    IsSortable="True"
    IsSorted="Ascending"
    ContentBinding="{Binding Attachment.Filename}"
    Key="Attachment.Url"
    TargetName="_blank"
    HeaderText="File Name"
    SortComparer="{StaticResource IsThisRequiredAttachmentRowComparer}"/>

11.1.20111.2115