WPF Reflections

Dec 13 2007   4:46PM GMT

ListView views – part 1

Mark Shurmer Profile: MarkWPF

What seems to be forgotten about the ListView control in WPF, at least by some people, is that it’s more than just a replacement for the DataGridView.

The point behind it is that it separates the data from the way it is presented, so you can have the same data presented in different ways, ie details or icon or list. It seems obvious, but it has been lost in some circles.
The presentation is controlled by the View property, which then creates a ViewBase derived class to do the presenting.

The gotcha is that the ListView in WPF (versions 3.0 and 3.5) only ships with one view – the GridView.
So can you add others, of course you can.

You simply have to derive a new class from ViewBase , draw the elements in the list , plug the new class in and bingo.

Part 2 will go through how you do that!

 Comment on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

Share this item with your network: