How do I sort a GridView column When a header Is clicked?
-
I am following instructions from this MSDN article: http://msdn.microsoft.com/en-us/library/ms745786.aspx 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?
-
Answer:
Look at http://tomlev2.wordpress.com/2009/08/04/wpf-automatically-sort-a-gridview-continued/ 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.
Zack Peterson at Stack Overflow Visit the source
Related Q & A:
- How do I calculate a xyz-position of a GPS-position relative to an other GPS-position?Best solution by Geographic Information Systems
- How can I sort a column in a DataGrid?Best solution by Stack Overflow
- How can I burn a .rmvb file onto a DVD for viewing on a regular DVD player?Best solution by Yahoo! Answers
- How do i make a signature for when i send an email?Best solution by Yahoo! Answers
- How can I get a text alert when I get an email?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.