I query some data from multiple databases and save them in a two-dimensional string array like this:
string[databaseID,fieldID]
... where fieldID = 0 represents the Name of the field.
The number of databases varies and can be between at least one and an undefined number. The number of fields is determined.
I want to have one column for the field names and one column for each databaseID. Each row should contain the data of a specific field of each database. It should for example look something like this:
FieldName | Database1 | Database2 | Database3
----------|-----------|-----------|-----------
Name1 | A | B | A
----------|-----------|-----------|-----------
Name2 | 1 | 2 | 3
How can I do this?
For creating the column headers, I already have this:
GridView gridView = new GridView();
gridView.AllowsColumnReorder = true;
GridViewColumn gvc1 = new GridViewColumn();
gvc1.DisplayMemberBinding = new Binding("");
gvc1.Header = "Feldname";
gvc1.Width = 100;
gridView.Columns.Add(gvc1);
for (int i = 0; i < databases.Count; i++)
{
GridViewColumn gvc = new GridViewColumn();
gvc.DisplayMemberBinding = new Binding("Path=Row[" + (i + 1) + "]"); //Still not sure, wether this is okay
gvc.Header = databases[i].DisplayName;
gvc.Width = 100;
gridView.Columns.Add(gvc);
}
lvBasic.View = gridView;
The XAML part I refer to is rather simple:
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
<ListView Name="lvBasic">
</ListView>
</ScrollViewer>
UPDATE: I thought it wouldn't matter, so I left out an aspect of my problem. I need to compare the data of database1 with all other databases and therefore need this layout or some other layout which is suitable for that task.

PivotGrid. Unfortunately this is not built in but there are many companies offering such possibilities in their frameworks (Telerik, Infragistics, DevExpress, etc). Needless to say, you wont get em for free :(