Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Multiple types of object binding to multiple ListViewItems in a ListView control....

$
0
0

Hi,

In my application, i want to bind a set object collection (say ParentClassCollections) to a listview. But my collection objects are derived from a base class. Say i have a 'ParentClass' & two child classes 'ChildClass1' and ChildClass2'. 'ChildClass2' is having some extra proeprties which i want to show to user in ListViewItem.
I have a collection of type 'ParentClass'.
So in my application, i want to create two different types of DataTemplates for two different child classes. I want to attach the ParentClassCollections collection to ListView but the content of the ListViewItem should vary according to the child class content.

How i can do different child objects binding to different ListViewItems using datatemplates or any other way?

Thanks
IamHuM


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>