title: Dictionary Binding to ListView WPF
body: <p>I have a List which contains Dictionary items. This means </p>
  
  <p>List[0] = Dictionary Item => Item[0] = id, Item[1] = Name, Item[2] = Amount. </p>
  
  <p>I need to show this in a ListView control in a Grid manner. The dictionary can vary. </p>
  
  <p>UPDATE: </p>
  
  <p>Each Item in the List looks like this: </p>
  
  <p>["_id"] = "11212131" 
  ["Title"] = "this is title" 
  ["DateCreated"] = "some date" </p>
  
  <p>The items inside the dictionary can be different. </p>
  
  <p>UPDATE 2: </p>
  
  <p>I am using the following code to create a dynamic Gridview control and then add the columns into the GridView control. It works but now there is a long horizontal line of same repeative columns. I need to display the column name and under that the data that belongs to that column. </p>
  
  <pre><code>  var gridview = new GridView();
  
              foreach (var o in objs)
              {
                  var dic = o as Dictionary&lt;String, Object&gt;;
                  var enumerator = dic.GetEnumerator();
                  while (enumerator.MoveNext())
                  {
                      var current = enumerator.Current;
                      var gridViewColumn = new GridViewColumn();
                      gridViewColumn.Header = current.Key; 
                      var binding = new Binding(current.Key);
                      //binding.Source = current;
  
                      gridViewColumn.DisplayMemberBinding = binding;
  
                      gridview.Columns.Add(gridViewColumn);
  
                  }
  
                  // new row 
  
              }
  
              lvCollections.View = gridview; 
  </code></pre>
  
  <p>UPDATE 3: </p>
  
  <p>I am pretty close. It works but it displays only a long single row with repeated columns. </p>
  
  <pre><code> var gridview = new GridView();
  
  
              foreach (var o in objs)
              {
  
                  var dic = o as Dictionary&lt;String, Object&gt;;
                  var enumerator = dic.GetEnumerator();
                  while (enumerator.MoveNext())
                  {var gridViewColumn = new GridViewColumn(); 
                      var current = enumerator.Current;
                      gridViewColumn.Header = current.Key;
                      var binding = new Binding();
                      binding.Source = current; 
                      binding.Path = new PropertyPath("Value"); 
  
                      gridViewColumn.DisplayMemberBinding = binding;
                      gridview.Columns.Add(gridViewColumn);
  
                  }
  
  
                  // new row 
  
              }
  
              lvCollections.ItemsSource = objs; 
              lvCollections.View = gridview; 
  </code></pre>