Zack Peterson
Zack Peterson

Reputation: 57373

How do I sort a GridView column When a header Is clicked?

I am following instructions from this MSDN article:
How to: Sort a GridView Column When a Header Is Clicked

But, I'm binding Entity Framework objects to the ListView.

I get a runtime NotSupportedException "Specified method is not supported" when the Sort() method fails to execute this line:

dataView.SortDescriptions.Clear();

How do I need to adapt this example for Entity Framework?

Upvotes: 1

Views: 4137

Answers (1)

HCL
HCL

Reputation: 36785

Look at this post. It's code written by Thomas Levesque for an attached property that enables the sorting of a GridView by it's column headers. Really well done. If it does not fit your needs, you can look on how he implemented its solution.

Upvotes: 2

Related Questions