I have a grid with just 1 row. I would like the amount of columns to be determined by the data context of the grid.
For instance, if I have a list of names exposed in an ObservableCollection property called 'Names' that return "Fred", "Joe", and "Anne", I would like three columns in the grid, each with a textbox bound to each name.
My thoughts so far:
1) Build the grid by hand in the code-behind and rebuild it when the ObservableCollection changes. I didn't go with this as it seemed a bit cludgy and not the WPF way of doing things.
2) Create a binding with the Grid's ColumnDefinitions property. This seemed more correct, but there's not a dependency property on the Grid for ColumnDefinition.