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 8234919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T18:38:21+00:00 2026-06-07T18:38:21+00:00

My WPF app using an XMLDataProvider for its data. The XML file has a

  • 0

My WPF app using an XMLDataProvider for its data. The XML file has a

<RELEASEDATE>dd/mm/yyyy</RELEASEDATE>

for each of the listed items. I’m sorting the data in the app using a

Listbox1.Items.SortDescriptions.Add(new SortDescription("RELEASEDATE", ListSortDirection.Descending));

The results aren’t what expected as the date is treated as a string.

What is the most elegant way around this? Can I somehow convert to a date inline?

  • 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-07T18:38:23+00:00Added an answer on June 7, 2026 at 6:38 pm

    You have to implement own IComparer:

    class DateTimeComparer : IComparer
        {
            public int Compare(object x, object y)
            {
                //To Do : Implement DataTime Comparering
            }
        } 
    

    and now assign the IComparer implementation to the collection’s ListCollectionView.CustomSort:

     ListCollectionView view = new ListCollectionView(ListBox.Items);
    
     view.CustomSort = new DateTimeComparer();
    

    See similar Question

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

Sidebar

Related Questions

I'm writing a WPF app and the font that I am using only has
In my WPF app, I am using MVVM. I am reading from an XML
I have a WPF app that binds a DataGrid to an XML document using
I have a WPF app that uploads XML data to a web service asynchronously.
I'm building a WPF app using pages and the navigation service. One of the
I'm developing a WPF app using MVVM. Most of my views have only xaml
I am creating a WPF app using MVVM. The app manages tagged documents, called
I'm creating a WPF app using the MVVM design pattern, and I'm trying to
I'm localizing a WPF app using the LocBaml method. Everything works great for UI
I'm hosting some web content in a WPF app using the WebBrowser control (or

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.