C# 如何使用c在XCeed DataGridControl(WPF)中添加ComboBox列#
我目前正在开发一个管理系统,我开始使用Microsoft DefaultDataGrid for WPF,但是,因为它没有分组功能,也没有过滤系统,所以我用Xceed datagrid对其进行了更改 问题是,我找不到任何方法使用c#添加组合框列。我什么都试过了,但都没用。这是我最后一次尝试: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
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
请帮忙