我使用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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top