MyCustomers を TreeListControl TreeListColumn FieldName="Id" Binding="How to bind CustomerId" にバインドしたいのですが、どうすればよいですか?
<dxg:TreeListControl Name="MyControl" ItemsSource="{Binding Path=MyCustomers}"
Height="296" Width="750" Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left">
<dxg:TreeListControl.Columns>
<dxg:TreeListColumn FieldName="Id" Binding="How to Bind CustomerID ?????" />
<dxg:TreeListColumn FieldName="CustomerGroup" Binding="How to Bind CustomerGroup ?????" />
</dxg:TreeListControl.Columns>
<dxg:TreeListControl.View>
<dxg:TreeListView AutoWidth="True" KeyFieldName="Id" ParentFieldName="ParentId" NavigationStyle="Row" />
</dxg:TreeListControl.View>
</dxg:TreeListControl>
ビューモデル:
public class CustomerViewModel : BaseViewModel
{
public IList<Model.App.Customer> MyCustomers
{
get;
private set;
}
public CustomerViewModel()
{
CustomerDetail = new CustomerDetail();
this.MyCustomers = CustomerRespiratory.SelectMyCustomers();
}
}
モデル:
public class Customer
{
public int CustomerID { get; set;}
public int CustomerGroup { get; set;}
}