Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
WPF Gridview sorting
Message
From
20/10/2009 13:41:03
Sid Meyers
Omegaware Consulting, Inc.
Minnesota, United States
 
 
To
All
General information
Forum:
ASP.NET
Category:
The Mere Mortals .NET Framework
Title:
WPF Gridview sorting
Environment versions
Environment:
C# 3.0
OS:
Vista
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01430138
Message ID:
01430138
Views:
102
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.
Reply
Map
View

Click here to load this message in the networking platform