DataGridComboBoxColumn not editable
Open
Nobody has claimed this yet.
bug
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 1k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
<DataGridComboBoxColumn Header="Anrede"
SelectedItemBinding="{Binding Salutation, Mode=TwoWay}"
ItemsSource="{Binding Source={StaticResource AvailableSalutations}, Mode=OneWay}"
Width="100"/>
I tried adding this DataGridComboBoxColumn to a ui:DataGrid and it shows the right value but I can't edit it.
Workaround:
<DataGridTemplateColumn Header="Anrede">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<ComboBox ItemsSource="{Binding DataContext.ViewModel.AvailableSalutations, RelativeSource={RelativeSource AncestorType=Page}, Mode=OneWay}"
SelectedItem="{Binding Salutation, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
IsEditable="False"
Background="Transparent"
BorderThickness="0"/>
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
To Reproduce
See examples in description.
Expected behavior
It is editable like every other column.
Screenshots
No response
OS version
Windows 11 24H2
.NET version
.NET Framework 4.8
WPF-UI NuGet version
4.0.2
Additional context
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the DataGridComboBoxColumn behavior shown in the issue and compare it with the working DataGridTemplateColumn workaround. Reproduce the binding on Windows/WPF using the supplied XAML, then verify that editing and the TwoWay SelectedItemBinding work as expected; the payload names no source file or test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100