C# 如何在网格单元模板中的RadRibbonDropDownButton内绑定ListView?

C# 如何在网格单元模板中的RadRibbonDropDownButton内绑定ListView?,c#,.net,wpf,radgridview,C#,.net,Wpf,Radgridview,我有一个rad网格视图,它将其itemssource绑定到一个“雇员”列表。 “雇员”实体具有“角色”属性的列表。如何将此“角色”绑定到列表视图,如下所示 例如:在第二列中,RadComboBox正确绑定。在第三列中,RadRibbonDropDownButton未正确绑定。 如何将角色列表绑定到ListView内部RadRibbonDropDownButton 请帮忙 class Employee { public string Name {get; set;} public

我有一个rad网格视图,它将其itemssource绑定到一个“雇员”列表。 “雇员”实体具有“角色”属性的列表。如何将此“角色”绑定到
列表视图,如下所示

例如:在第二列中,
RadComboBox
正确绑定。在第三列中,
RadRibbonDropDownButton
未正确绑定。 如何将角色列表绑定到
ListView
内部
RadRibbonDropDownButton

请帮忙

class Employee
{
    public string Name {get; set;}
    public List<Role> RolesList {get; set;}
}
class Role
{
    public int RoleId {get; set;}
    public string RoleName {get; set;}
    public string RoleCategory {get; set;}
}
<tk:RadGridView ItemsSource="{Binding Path=EmployeeList,Mode=TwoWay}" AutoGenerateColumns="False">
    <tk:RadGridView.Columns>
        <tk:GridViewDataColumn Header="Employee Name" DataMemberBinding="{Binding Name}" IsReadOnly="True"/>
        <tk:GridViewDataColumn Header="Roles" Width="410">
            <tk:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <!--this binds properly-->
                    <tk:RadComboBox ItemsSource="{Binding RolesList}" DisplayMemberPath="RoleName" SelectedValuePath="RoleId" />
                </DataTemplate>
            </tk:GridViewDataColumn.CellTemplate>
        </tk:GridViewDataColumn>
        <tk:GridViewDataColumn Header="Roles" Width="410">
            <tk:GridViewDataColumn.CellTemplate>
                <DataTemplate>
                    <tk:RadRibbonDropDownButton>
                        <tk:RadRibbonDropDownButton.DropDownContent>
                            <ListView ItemsSource="{Binding RolesList}">
                                <ListView.View>
                                    <GridView AllowsColumnReorder="False">
                                        <GridViewColumn DisplayMemberBinding="{Binding RoleName}" Header="Role Name" Width="75" ></GridViewColumn>
                                        <GridViewColumn DisplayMemberBinding="{Binding RoleCategory}" Header="Role Category" Width="175" ></GridViewColumn>
                                    </GridView>
                                </ListView.View>
                            </ListView>
                        </tk:RadRibbonDropDownButton.DropDownContent>
                    </tk:RadRibbonDropDownButton>
                </DataTemplate>
            </tk:GridViewDataColumn.CellTemplate>
        </tk:GridViewDataColumn>
    </tk:RadGridView.Columns>
</tk:RadGridView>
class员工
{
公共字符串名称{get;set;}
公共列表角色列表{get;set;}
}
阶级角色
{
public int RoleId{get;set;}
公共字符串RoleName{get;set;}
公共字符串角色分类{get;set;}
}

添加DataContext={Binding}修复了绑定问题。

添加DataContext={Binding}修复了绑定问题。

嗯,为什么要在Gridview中使用Ribbon元素?我希望下拉列表是gridUhm,为什么要在Gridview中使用Ribbon元素?我希望下拉列表是网格