DataGridComboBoxColumn
I don't understand why the current value and the list are empty
<DataGridComboBoxColumn Header="CustomersMail" SelectedValueBinding="{Binding oCustomersMail}" SelectedValuePath="Email" DisplayMemberPath="Email">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding ExistingCustomersEmails}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding ExistingCustomersEmails}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
<DataGridComboBoxColumn Header="CustomersMail" SelectedValueBinding="{Binding oCustomersMail}" SelectedValuePath="Email" DisplayMemberPath="Email">
<DataGridComboBoxColumn.ElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding ExistingCustomersEmails}" />
</Style>
</DataGridComboBoxColumn.ElementStyle>
<DataGridComboBoxColumn.EditingElementStyle>
<Style TargetType="ComboBox">
<Setter Property="ItemsSource" Value="{Binding ExistingCustomersEmails}" />
</Style>
</DataGridComboBoxColumn.EditingElementStyle>
</DataGridComboBoxColumn>
public List<string> ExistingCustomersEmails
{
get
{
// Example of a list of existing email addresses
return new List<string> { "[email protected]", "[email protected]", "[email protected]" };
}
}
public List<string> ExistingCustomersEmails
{
get
{
// Example of a list of existing email addresses
return new List<string> { "[email protected]", "[email protected]", "[email protected]" };
}
}
internal class OrdView
{
public string? oCustomersMail { get; set; }
}
internal class OrdView
{
public string? oCustomersMail { get; set; }
}
2 Replies