DataSourceCriteria를 XAF의 속성에 종속되게 만드는 방법은 무엇입니까?
-
10-12-2019 - |
문제
나는 eXpressApp Framework를 사용하여 Windows 응용 프로그램을 개발합니다.내 클래스의 열거형 속성에 따라 조회 보기 속성 편집기를 필터링하고 싶습니다.
이것은 내 코드입니다.
카테고리 클래스:
private TranType tranType;
public TranType TranType
{
get
{
return tranType;
}
set
{
SetPropertyValue("TranType", ref tranType, value);
}
}
private string categoryName;
public string CategoryName
{
get
{
return categoryName;
}
set
{
SetPropertyValue("CategoryName", ref categoryName, value);
}
}
private Category parentCategory;
public Category ParentCategory
{
get
{
return parentCategory;
}
set
{
SetPropertyValue("ParentCategory", ref parentCategory, value);
}
}
트랜 클래스:
private Category category;
[DataSourceCriteria("TranType == TranType")]
public Category Category
{
get
{
return category;
}
set
{
SetPropertyValue("Category", ref category, value);
}
}
private static TranType myTranType;
[ImmediatePostData]
public TranType MyTranType
{
get
{
return myTranType;
}
set
{
SetPropertyValue("MyTranType", ref myTranType, value);
}
}
각 Category
가지고있다 TranType
예를 들어 사용자가 선택할 때를 원합니다. TranType=Expense
, 주어진 기준에 따라 조회에서 필터링된 카테고리 TranType
.
도와 줘서 고마워.
해결책
원하는 것이 Tran 클래스 보기의 조회에서 사용 가능한 범주를 필터링하는 것이라면 다음과 같이 입력하세요.
private Category category;
[DataSourceCriteria("MyTranType")]
public Category Category
{
get
{
return category;
}
set
{
SetPropertyValue("Category", ref category, value);
}
}
private static TranType myTranType;
[ImmediatePostData]
public TranType MyTranType
{
get
{...
이 문서를 살펴보세요 http://documentation.devexpress.com/#Xaf/CustomDocument2681
제휴하지 않습니다 StackOverflow