dotnet / dotnet/wpf

WPF: initial value of ComboBox with Grouping is set to first entry of ListCollectionView

Open
#3,438 1 comment 1 reaction 0 assignees View on GitHub
Bug
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

_This issue has been moved from [a ticket on Developer Community](https://developercommunity.visualstudio.com/content/problem/1169841/wpf-initial-value-of-combobox-with-grouping-is-set.html)._

---

[severity:Other]

Hello,

I´m using a ComboBox with grouping by using the PropertyGroupDescriptions of a ListCollectionView. So far so good, but the initial value is set to the first Item of the lcv. No difference when commenting out the binding for SelectedValue.

Without grouping the initial value is null and the box is empty. Is there a way achive this behavior without adding an empty item to the collection?

I’ve already wrote the issue to the telerik forum for the RadComboxBox, but probably they can find a work around at most, when the behavior depends on the default ComboBox.

https://www.telerik.com/forums/initial-value-of-radcombox-with-grouping

.NET Framwork 4.8

```

<ComboBox ItemsSource="{Binding ArtenLcv}" SelectedValuePath="Wert"
DisplayMemberPath="Text" SelectedValue="{Binding ArtSelected}">
<ComboBox.GroupStyle>
<GroupStyle>
<GroupStyle.HeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Name}" />
</DataTemplate>
</GroupStyle.HeaderTemplate>
</GroupStyle>
</ComboBox.GroupStyle>
</ComboBox>
```

---
### Original Comments

#### Feedback Bot on 9/2/2020, 10:17 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

---
### Original Solutions
(no solutions)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.