كيفية جعل DataSourceCriteria تابعة لخاصية في XAF؟
-
10-12-2019 - |
سؤال
أستخدم إطار عمل eXpressApp لتطوير تطبيق 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