WPF Reflections

Feb 8 2008   3:42PM GMT

ListView – why does ItemTemplate not do anything



Posted by: MarkWPF
Tags:
WPF

Why does ItemTemplate not do anything?

This is a question that I have asked myself this week, in between banging my head against the wall.

What I wanted to do was apply a template to a row (in a GridView), in addition to the cell templates specified in the Columns attribute in the GridView.
Unfortunately, nothing happens :-(

If you want to do this, you have to use a style instead.
A very good example of this can be found on Bea Costa’s blog

1  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Matthiasshapiro
    The ListView is a freaking monster. My guess is that because the ListView is a decendant of the ItemsControl, it inherits the ItemTemplate property. And while the ItemTemplate property is wonderfully useful in other ItemsControl decendants (like the ComboBox), the ListView does acrobatics in the way it displays data, requiring the use of the ItemContainerStyle and it's accompanying template to do any styling. If you have any more questions about the ListView, I'm trying to blog up as much ListView info as possible... drop by and ask a question and I'll see if I can't blog an answer.
    0 pointsBadges:
    report

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: