1
.NET / Re: PropertySetDefinition with a List data type
« Last post by Jeff_M on Today at 02:43:18 PM »Okay, more headway made. I finally realized that I needed a new class (PropList) to hold the list and the current value for the object. I have not yet been able to get the Combobox to display the list or current value. The DataTable is created properly, with the column for the List type created as a PropList type. Then in the Window the DataGrid's ItemsSource is set to the ViewModel's property for the DataTable. All the columns fill with the correct values, except that PropList column. One of the solutions I found in my searches says that adding this to the XAML should fix it:
Where CurrentValue and Values are the 2 properties of PropList. Then include this in the code behind for the AutoGeneratingColumn event:
Code - XML: [Select]
- <DataGrid.Resources>
- <DataTemplate x:Key="dataItemCellTemplate">
- <ComboBox SelectedValue="{Binding DataContext.CurrentValue, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
- ItemsSource="{Binding DataContext.Values}"/>
- </DataTemplate>
- </DataGrid.Resources>
Where CurrentValue and Values are the 2 properties of PropList. Then include this in the code behind for the AutoGeneratingColumn event:
Code - C#: [Select]
But something is still amiss and I am at a loss on where to look.