1 year ago

#67318

test-img

BuBa

C# WPF Combobox closes instantly

<DataGridTemplateColumn Width="4*" Header="{DynamicResource LANGUAGEHEADER_MULTIPLE}" MaxWidth="100">
                <DataGridTemplateColumn.HeaderStyle>
                    <Style TargetType="{x:Type DataGridColumnHeader}">
                        <Setter Property="FontWeight" Value="Bold" />
                        <Setter Property="Background" Value="Transparent" />
                    </Style>
                </DataGridTemplateColumn.HeaderStyle>
                <DataGridTemplateColumn.CellTemplate>
                    <DataTemplate>
                        <StackPanel>
                            <TextBlock Text="{Binding language}"></TextBlock>
                            <ComboBox DropDownClosed="ComboBox_DropDownClosed" DropDownOpened="ComboBox_DropDownOpened" Margin="0,-25,0,0"></ComboBox>
                        </StackPanel>
                    </DataTemplate>
                </DataGridTemplateColumn.CellTemplate>
            </DataGridTemplateColumn>

When clicking onto the dropdown for the first time it automatically closes. After the first time it works normally. Does anyone have any clue?

c#

wpf

combobox

0 Answers

Your Answer

Accepted video resources