How to use two templates for ListViewItem using WPF

Posted by Gregor on Stack Overflow See other posts from Stack Overflow or by Gregor
Published on 2010-05-04T10:23:18Z Indexed on 2010/05/04 10:28 UTC
Read the original article Hit count: 424

Filed under:
|
|
|

Hi,

I would like to have a ListView that would have have items similar to Microsoft Outlook inbox with items arranged by Conversations (see the attached photo). An item can either be a simple textblock containing the topic of the conversation (on the photo this are the blue lines) or it can contain email information specified by the ListView's header. It would be best if the items with conversation topics would be push buttons so that emails inside that conversation could be shown or hidden by pressing this button.

Any ideas how can I achieve this? Do I specify two ListViewItem templates? If yes, how do I tell in the code which template to use for each item?

Any help will be GREATLY appreciated!! Regards, Gregor

alt text

© Stack Overflow or respective owner

Related posts about wpf

Related posts about listview