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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T11:37:53+00:00 2026-05-18T11:37:53+00:00

I have a WPF4 DataGrid (the one that’s included with WPF4) with columns ‘Surname’,

  • 0

I have a WPF4 DataGrid (the one that’s included with WPF4) with columns ‘Surname’, ‘First Names’ etc. When the user clicks a column header, for example ‘Surname’, everything gets sorted in the right order according to my culture settings, e.g:

Anderson
Rockford
Ångström

I want the ‘Surname’ column to be pre-sorted, so I’ve added

    <CollectionViewSource.SortDescriptions>
        <scm:SortDescription PropertyName="SurName" />
    </CollectionViewSource.SortDescriptions>

just like in the answer to the Pre-sorting a DataGrid in WPF question. The problem is, that WPF now uses a different sort order where ‘Å’ is sorted like ‘A’ (I guess that’s a US sort order):

Andersson
Ångström
Rockford

Manually clicking the ‘Surname’ header re-sorts the names, this time according to my culture settings.

How do I tell WPF to use the current culture setting when pre-sorting the DataGrid?

  • 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-05-18T11:37:53+00:00Added an answer on May 18, 2026 at 11:37 am

    Have you tried setting the CollectionViewSource’s Culture property? Something like (drycoded) Edited per your comment:

    ... in your namespaces
    xmlns:glob="clr-namespace:System.Globalization;assembly=mscorlib"
    ....
    
    
    <CollectionViewSource Culture="{x:Static glob:CultureInfo.CurrentCulture}">
        <CollectionViewSource.SortDescriptions>
            <scm:SortDescription PropertyName="SurName" />
        </CollectionViewSource.SortDescriptions>
    </CollectionViewSource>
    

    I’m not sure why the CollectionViewSource wouldn’t use the same culture by default, but if it’s not this should be the property that fixes it for you.

    See also this article on how binding seems to use the wrong culture when the target is a string, perhaps it can shed some light for you: http://www.nbdtech.com/Blog/archive/2009/02/22/wpf-data-binding-cheat-sheet-update-the-internationalization-fix.aspx

    Or this question: WPF XAML Bindings and CurrentCulture Display

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

Sidebar

Related Questions

I need to style hyperlinks in WPF4 DataGrid control (they appear in columns of
I have a WPF 4.0 DataGrid with AutoGenerated columns. I would like to only
I have a WPF 4.0 DataGrid that is bound to a DataTable using AutoGenerateColumns=True.
I have a wpf4 that I am referenced the enterprise library 5. I want
I have a project that is WPF4 (with vb.net behind). I have a window
I have a WPF 4 DataGrid whereby the first ComboBox changes what the second
Have a simple form that has a PictureBox in one location. I want to
I have a WPF4 application i have 1 window which editing data : main
Have deployed numerous report parts which reference the same view however one of them
have a problem. At first look at this HTML <div id=map style=background-image: url(map.png); width:

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.