Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
WPF Gridview sorting
Message
De
20/10/2009 13:41:03
Sid Meyers
Omegaware Consulting, Inc.
Minnesota, États-Unis
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
WPF Gridview sorting
Versions des environnements
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Divers
Thread ID:
01430138
Message ID:
01430138
Vues:
103
I am trying to implement a sortable gridview in WPF. Here is the code that implements the sort for the column
        private void Sort(string sortBy, ListSortDirection direction)

        {

            lastDirection = direction;

            ICollectionView dataView = CollectionViewSource.GetDefaultView(this.ItemsSource);

 

            dataView.SortDescriptions.Clear();

            SortDescription sd = new SortDescription(sortBy, direction);

            dataView.SortDescriptions.Add(sd);

            dataView.Refresh();

        }
Everything looks fine, the ItemsSource is my Business Object Entity collection, but the grid doesn't update when clicking on the column headers. It does update the column header properly with the sort symbol so it is processing the click event and it does update the SortDescription collection. I'm trying to work through the Business Object entity logic but just wondering if anyone else has done this or if I'm missing something obvious, which is usually the case.

-Sid Meyers.
Répondre
Fil
Voir

Click here to load this message in the networking platform