0

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

谢谢你的帮助。

4

2 回答 2

3

如果您想做的是在 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

于 2012-03-13T00:03:58.527 回答
0

以这种方式工作正常。

    BloqueDeZona _Bloque;
    [XafDisplayName("Bloque")]
    [ImmediatePostData]
    [Persistent("id_bloque")]
    public BloqueDeZona Bloque
    {
        get { return _Bloque; }
        set { SetPropertyValue(nameof(Bloque), ref _Bloque, value); }
    }

    Zona _Zona;
    [XafDisplayName("Zona")]
    [DataSourceCriteria("Bloque = '@this.Bloque'")]
    [Persistent("oid_zona")]
    public Zona Zona
    {
        get { return _Zona; }
        set { SetPropertyValue(nameof(Zona), ref _Zona, value); }
    }
于 2022-01-06T21:31:33.770 回答