var columns = records.First()
.Properties
.Select((x, i) => new {Name = x.Name, Index = i})
.ToArray();
foreach (var column in columns)
{
var binding = new Binding(string.Format("Properties[{0}].Value", column.Index));
dataGrid.Columns.Add(new DataGridTextColumn() {Header = column.Name, Binding = binding });
}