I\'ve created a DataGrid in XAML and the ItemsSource is binded to an ObservableCollection of a certain class that contains properties. Then in C#, I cre
Firstly, this should be easy... secondly, why are you building (and binding) columns in C#? Eek.
XAML (I'm using a regular grid because I'm lazy):
C#:
void Window1_Loaded(object sender, RoutedEventArgs e)
{
var dahList = new List();
dahList.Add(new StatsOperation
{
Operation = "Op A",
Choices = new string[] { "One", "Two", "Three" },
});
dahList.Add(new StatsOperation
{
Operation = "Op B",
Choices = new string[] { "4", "5", "6" },
});
this.MyListView.ItemsSource = dahList;
}
The Results:
WPF grid with dynamic combo box choices http://www.singingeels.com/Articles/Articles/UserImage.aspx?ImageID=b1e3f880-c278-4d2b-bcc2-8ad390591200