Here is something like that :
public partial class DynamicListViewWindow : Window
{
public DynamicListViewWindow()
{
InitializeComponent();
ObservableCollection<Person> personList = new ObservableCollection<Person>();
personList.Add(new Person() { FirstName = "John", LastName = "Doe", Age = 30, Address = "123 Doe Street", Phone = "111-111-1111" });
personList.Add(new Person() { FirstName = "Jane", LastName = "Doe", Age = 28, Address = "123 Doe Street", Phone = "222-222-2222" });
personList.Add(new Person() { FirstName = "Mark", LastName = "Doe", Age = 15, Address = "123 Doe Street", Phone = "333-333-3333" });
personList.Add(new Person() { FirstName = "John", LastName = "Smith", Age = 40, Address = "123 Doe Street", Phone = "444-444-4444" });
personList.Add(new Person() { FirstName = "Rosy", LastName = "Smith", Age = 36, Address = "123 Doe Street", Phone = "555-555-5555" });
PersonListView.ItemsSource = personList;
}
private void PersonListView_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (PersonListView.SelectedIndex >= 0)
{
Object data = PersonListView.SelectedItem;
PropertyInfo[] properties = data.GetType().GetProperties(BindingFlags.Public | BindingFlags.Instance);
ExtraPropertiesPanel.Children.Clear();
foreach (PropertyInfo prop in properties)
{
TextBox tb = new TextBox();
Binding b = new Binding() { Source = data, Path = new PropertyPath(prop.Name) };
tb.SetBinding(TextBox.TextProperty, b);
ExtraPropertiesPanel.Children.Add(tb);
}
}
}
}
public class Person
{
public String FirstName { get; set; }
public String LastName { get; set; }
public Int32 Age { get; set; }
public String Address { get; set; }
public String Phone { get; set; }
}
XAML
<Window x:Class="WPFApplication1.DynamicListViewWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window"
Height="300"
Width="300">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Border Grid.Column="0">
<ListView Name="PersonListView" SelectionChanged="PersonListView_SelectionChanged">
<ListView.View>
<GridView>
<GridViewColumn Header="First Name"
DisplayMemberBinding="{Binding FirstName}" />
<GridViewColumn Header="Last Name"
DisplayMemberBinding="{Binding LastName}" />
</GridView>
</ListView.View>
</ListView>
</Border>
<Border Grid.Column="1">
<StackPanel Name="ExtraPropertiesPanel"></StackPanel>
</Border>
</Grid>