OK, this might not be the most "ideal" method (I'd prefer to get it going in XAML), but here's something to get you started. This code starts with a List called Items, and a Grid declared with the name ItemsGrid.
int maxRow = Items.Select(i => i.RowId).Max();
int maxCol = Items.Select(i => i.ColumnId).Max();
for (int i = 0; i <= maxRow; i++)
ItemsGrid.RowDefinitions.Add(new RowDefinition());
for (int i = 0; i <= maxCol; i++)
ItemsGrid.ColumnDefinitions.Add(new ColumnDefinition());
foreach (var item in Items)
{
TextBlock newItem = new TextBlock() { Text = item.Value };
ItemsGrid.Children.Add(newItem);
Grid.SetRow(newItem, item.RowId);
Grid.SetColumn(newItem, item.ColumnId);
}
Alternatively, you could look into actual DataGrid controls outside of what's cooked into the .NET Framework right now.
The WPF Toolkit has a DataGrid that I've used successfully on several projects:
http://wpf.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=29117
Third-party vendors also produce simimlar grids. Prominent ones, in no particular order, are Xceed, Telerik, Infragistics, and Syncfusion.
Hope that helps!
Tim