C#C
C#2y ago
ApathyErr

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>

public List<string> ExistingCustomersEmails
{
    get
    {
        // Example of a list of existing email addresses
        return new List<string> { "example1@example.com", "example2@example.com", "example3@example.com" };
    }
}

internal class OrdView
{
    public string? oCustomersMail { get; set; }
}
image.png
image.png
Was this page helpful?