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

  • Home
  • SEARCH
  • 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 5943155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:21:16+00:00 2026-05-22T16:21:16+00:00

When clicking on a DataGrid ColumnHeader, the datagrid would automatically sort the data, if

  • 0

When clicking on a DataGrid ColumnHeader, the datagrid would automatically sort the data, if the underlying dataSource is a CollectionView.

How does it work internally, does it just add SortDescriptors() to the View in order to sort or does it utilize an IComparer class?

I think its rather using SortDescriptors, hence its so slow in sorting.

I have done some research and it says using

CollectionView.CustomSort = a class implementing IComparer is much faster approach.

So in order to try this approach, how do I override the automatic sorting mechanism of DataGrid – when clicked on a columnheader – and do my own sorting with the CustomSort?

Any help on this is highly appreciated.

  • 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-22T16:21:17+00:00Added an answer on May 22, 2026 at 4:21 pm

    You can use the Sorting Event which will give you the Column they are using to sort and in which direction.

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

Sidebar

Related Questions

In a flex datagrid, by default clicking on column headers does sorting. I want
I have a datagrid with master detail implementation as follows: <data:DataGrid x:Name=dgData Width=600 ItemsSource={Binding
I have a scenario where I want to show hierarchical data in a DataGrid
When clicking the Update Model From Database option in an EF data model, any
Let’s say I have a data grid and there’s a method attached to clicking
Clicking will not work. Checked source, list is populated with PHP.
I have a datagrid view in my form and I like to sort the
I use MongoDB as application data storage. To sort retrieved documents, I write the
How we get global x,y position,when we are clicking in a datagrid cell.
Our DataGrid-heavy application likes to throw exceptions when double-clicking the space between rows used

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.