0

eXpressAppFrameworkを使用して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 に答える