0
MyCustomers를 TreeListControl에 바인딩하려합니다. TreeListColumn FieldName = "Id"Binding = "CustomerId를 바인딩하는 방법" 어떻게 할 수 있습니까?DevExpression에서 ViewModel을 바인딩하는 방법 TreeListColumn?
<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();
}
}
모델 : 당신은 부모 필드로 키 필드와 CustomerGroup로 CustomerID를 지정해야합니다
public class Customer
{
public int CustomerID { get; set;}
public int CustomerGroup { get; set;}
}
당신이 시도 무엇 첫눈에 내가 바인딩 말할 = "{CustomerID를 바인딩}"당신이 필요로 될 수있다 – michele