Thursday, 10 December 2009

Column Header Sorting In WPF - Damn You Intellisense!

Ever since I started using WPF I have been annoyed by the lack of sorting support from its column headers, it didnt even seem to offer a click handler for the headers of any kind!

Having wandered around Google I found some forums where users were talking about the problem, with one MS post saying "sorry its not supported, we will endeavour to add it in the next version" while referencing version 1.

I stumbled upon one post which said that "GridViewColumnHeader.Click" would do the trick, but when I tried to use it there was no sign in intellisense. I use Visual Studio 2008 so I thought that maybe it was something from a 2005 service pack.

At the time I moved on to something else but I had the same problem this week so I started researching again. I found nothing at first, but then I stumbled upon a forum where a user said "its not in intellisense, but if you type it in and hit '=' it will generate the correct event handler as usual and it will work perfectly"

Voila, problem solved

No comments:

Post a Comment