Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8328519
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T01:28:18+00:00 2026-06-09T01:28:18+00:00

I would like to do custom sorting for my ItemsSource as I get this

  • 0

I would like to do custom sorting for my ItemsSource as I get this exception:

Failed to compare two elements in the array.

This is obvious as I use a converter class to display the proper value based on the object. The object is of type object and can contain multiple types, so the sorting doesn’t work here. I went on the internet but the only solution is for a ListCollectionView, which mine isn’t. This wouldn’t be such a bad thing, except for the fact that the other CollectionView class doesn’t provide us with a CustomSort property.

One way I could thing of solving this is by using the SortMemberPath property on the DataGridTextColumn, but this is far from ideal as I need to create a new property for each property I display (with the use of the converter). This results in unneeded clutter and makes my classes look terrible. This ‘solution’ also seems like a bit of a complete workaround to me and I hope that there is a better solution. The only problem is, I couldn’t find it, does anyone know a better way?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T01:28:19+00:00Added an answer on June 9, 2026 at 1:28 am

    I think there is no easy way of sorting by using the CollectionView or OOTB features of the DataGrid. One Solution could be to sort your list which you bound as the ItemsSource.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to make the custom UISlider, something like this |o----------| -> |-----O------|
I would like to create a custom document library where I use the standard
How would I go about sorting an array of NSString Objects by a custom
I would like to implement custom sorting on a custom databound GridView. OnSorting has
I would like my custom browser to auto fill in a form when it
I would like to add custom attributes to a MySQL table which I can
I would like to read custom setting which i have done in ServiceConfiguration.cscfg &
I would like to add a custom calculation method to a managed object (which
I would like to have a custom view in my application that consists of
I would like to create a custom control in order to display a pie

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.