1
私は、そのアイテムソースを 'Employee's'のリストにバインドするradグリッドビューを持っています。 「従業員」エンティティには「ロール」プロパティのリストがあります。この「ロール」をListView
にバインドするにはどうすればよいですか?グリッドセルテンプレート内のRadRibbonDropDownButton内でListViewをバインドする方法はありますか?
例として:第2列のRadComboBox
が正しく結合します。最後の列では、RadRibbonDropDownButton
は正しく結合しません。 RolesListを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>
なぜ、GridviewでRibbon-Elementを使用していますか? – lokusking
ドロップダウンをグリッドにしたい – Jeevan