English 中文(简体)
WPF DataGridComboBoxColumn
原标题:WPF DataGridComboBoxColumn

Hello I m利用WPF DataGrid和I m试图让ComboBox Column工作。

<tk:DataGridComboBoxColumn Header="GroupLevel"
                           DisplayMemberPath="Type"
                           SelectedItemBinding="{Binding Path=GroupLevel}"
                           >
    <tk:DataGridComboBoxColumn.EditingElementStyle>
        <Style TargetType="ComboBox">
            <Setter Property="ItemsSource" Value="{Binding Path=GroupLevel.Group.GroupLevels}" />
        </Style>
    </tk:DataGridComboBoxColumn.EditingElementStyle>

</tk:DataGridComboBoxColumn>

当我看上电网时,该栏像没有使用显示成员的道路一样是空白的。 但是,一旦我点击 column机一栏,便显示和显示我的物品包中的所有物品,并选择适当的物品,我知道,所有约束都正确运作,甚至显示显示“成员”。 当I m不编辑该囚室时,该囚室就显示出空白。

我是否错过了某处财产?

Thanks, Raul

最佳回答

确实,这是因为,如果你不 忙,你会这样做。 Column没有物品来源,也没有Combo 盒子没有物品来源就有一个选定的项目。 您一经编辑,一栏就从物品来源取而代之,一切都是冷却。 您可以确定这一点,具体指明诸如:

<tk:DataGridComboBoxColumn.ElementStyle>
    <Style TargetType="ComboBox">
        <Setter Property="ItemsSource" Value="{Binding Path=GroupLevel.Group.GroupLevels}" />
    </Style>
</tk:DataGridComboBoxColumn.ElementStyle>

其后,你的编辑部分和(非编辑)内容都相同。

问题回答

暂无回答




相关问题
WPF Datagrid, Setting the background of combox popup

I would like to change the color of the popup background when using a DatagridComboboxColumn in the WPF Toolkit datagrid. I ve edited the Template for a normal Combobox and it works great for selected ...

How to insert ComboBox item into ListBox? [winforms]

The question is very simple, How to insert ComboBox selected item into ListBox using c#? I have tried with this: listbox.Items.Add(combobox.SelectedItem); and some other permutations but it always ...

How do I bind a ComboBox to a one column list

I ve seen how to bind a ComboBox to a list that has columns like this: ItemsSource="{Binding Path=Entries}" DisplayMemberPath="Name" SelectedValuePath="Name" SelectedValue="{Binding Path=Entry}" But ...

Wpf Combobox Limit to List

We are using Wpf Combobox to allow the user to do the following things: 1) select items by typing in the first few characters 2) auto complete the entry by filtering the list 3) suggesting the first ...

热门标签