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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T00:39:59+00:00 2026-05-17T00:39:59+00:00

Firstly let me clarify (if the title wasn’t clear enough): I’m discussing System.Windows.Controls.DataGrid from

  • 0

Firstly let me clarify (if the title wasn’t clear enough): I’m discussing System.Windows.Controls.DataGrid from the .NET 4.0 Framework, not the toolkit edition.

I’m currently building up a small re-usable set of classes/view models/etc in my project to build a rather powerfull DataGrid for my application.

Now, by default given an IEnumarable<> ItemsSource the DataGrid control supports header-clicking column sorting.

However, my implementation now uses a CollectionViewSource and ICollectionView to expose data members to the DataGrid. When hooked up in this fashion it seems to rely on the SortDescriptions to sort.

While I like having control from code (could be hooked into all sorts of things) I also require the ability for my users to click the header bars to sort thier results. I’m looking for a way to hook the header-bar clicks to signal my code to adjust the CollectionViewSource appropriately.

  1. Am I going to have to re-style the header buttons to do fire the events?
  2. Is there a way to hook the sort events from the DataGrid control’s existing headers?
  3. What is the best way to go about this?
  4. Am I using ICollectionView incorrectly?
  • 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-17T00:40:00+00:00Added an answer on May 17, 2026 at 12:40 am

    Actually I found the answer. A complete blunder on my part. It stemmed from settings on the Columns in the DataGrid Control.

    Had to make sure that CanUserSort="True" was set on the DataGridColumn, and that the SortMemberPath property was set.

    Example:

                <DataGridTemplateColumn Header="Account #" Width="Auto" CanUserSort="True" SortMemberPath="AccountNum">
                    <DataGridTemplateColumn.CellTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding AccountNum}" />
                        </DataTemplate>
                    </DataGridTemplateColumn.CellTemplate>
                </DataGridTemplateColumn>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Firstly let me clarify (if the title wasn't clear enough): I'm discussing System.Windows.Controls.DataGrid from
Firstly, let me apologise for the title, I honestly couldn't think how to word
firstly, let me quote a bit an essay from Expert Python Programming book: In
Firstly, let me start by saying that I haven't ever directly used SQL views.
Firstly, let me say that I've been searching the Internet, rewriting scripts and I
Firstly, sorry for my English (I'm from China). By reading this article( how to
Firstly, let me introduce general architecture of a project. It is hierarchical. We develop
Firstly, let me say that I've been on this issue for pretty much 2
Firstly, let me give a brief description of the scenario. I'm writing a simple
Let's say I have some email: some_email@yahoo.com . Firstly I would want to remove

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.