Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/wpf/13.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何使用c在XCeed DataGridControl(WPF)中添加ComboBox列#_C#_Wpf_Datagrid_Xceed - Fatal编程技术网

C# 如何使用c在XCeed DataGridControl(WPF)中添加ComboBox列#

C# 如何使用c在XCeed DataGridControl(WPF)中添加ComboBox列#,c#,wpf,datagrid,xceed,C#,Wpf,Datagrid,Xceed,我目前正在开发一个管理系统,我开始使用Microsoft DefaultDataGrid for WPF,但是,因为它没有分组功能,也没有过滤系统,所以我用Xceed datagrid对其进行了更改 问题是,我找不到任何方法使用c#添加组合框列。我什么都试过了,但都没用。这是我最后一次尝试: for (int i = 0; i < this.DGV.Columns.Count; i++) { var Column = this.DGV.Columns[i]; if (Co

我目前正在开发一个管理系统,我开始使用Microsoft DefaultDataGrid for WPF,但是,因为它没有分组功能,也没有过滤系统,所以我用Xceed datagrid对其进行了更改

问题是,我找不到任何方法使用c#添加组合框列。我什么都试过了,但都没用。这是我最后一次尝试:

for (int i = 0; i < this.DGV.Columns.Count; i++)
{
    var Column = this.DGV.Columns[i];

    if (Column.FieldName == "BranchGroupId")
    {
        System.Windows.FrameworkElementFactory comboBox = new System.Windows.FrameworkElementFactory(typeof(ComboBox));

        comboBox.SetValue(ComboBox.ItemsSourceProperty, ((ViewModel.BranchViewModel)this.DataContext).BranchesGroup_Collection);
                                          
        comboBox.SetValue(ComboBox.DisplayMemberPathProperty, "Name");
                                          
        comboBox.SetValue(ComboBox.SelectedValuePathProperty, "Id");
                      
        this.DGV.Columns[i].CellEditor = new Xceed.Wpf.DataGrid.CellEditor();
        this.DGV.Columns[i].CellEditor.EditTemplate = new System.Windows.DataTemplate();
        this.DGV.Columns[i].CellEditor.EditTemplate.VisualTree = comboBox;
    }
}
for(int i=0;i
请帮忙