I have a datagrid in which one column would be title. I want the title to be able to be editted and the edit to be a comboBox that contains a list of titles based on the sex of the person the row represents. So say one would have "Mr" in the drop down for men and then the other would have "Ms.", "Mrs." and "Miss" for women. So I can't figure out a way to get this to work and have the item source change depending on the value of the bound object. Here's a snip of what (I have so far...it works fine for the comboBox's itemsource but the trigger doesn't update the source. I'm not sure if there is a better way to do this I've also looked at a template selector but I'm open to any suggestions.
<my:DataGrid AutoGenerateColumns="False" Margin="30,20,130,77" Name="dataGrid1">
<my:DataGrid.Columns>
<my:DataGridTemplateColumn Header="Title" MinWidth="100">
<my:DataGridTemplateColumn.CellEditingTemplate>
<DataTemplate>
<DataTemplate.Triggers>
<DataTrigger Binding="{Binding Path = Sex}" Value ="F">
<Setter Property="ComboBox.ItemsSource" Value="{StaticResource Titles2}" />
</DataTrigger>
</DataTemplate.Triggers>
<ComboBox ItemsSource="{StaticResource Titles}"
SelectedItem="{Binding Title}" />
</DataTemplate>
</my:DataGridTemplateColumn.CellEditingTemplate>
<my:DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Title}" />
</DataTemplate>
</my:DataGridTemplateColumn.CellTemplate>
</my:DataGridTemplateColumn>
Thanks for any help!!