0

ListView でフッターを自動的に表示する方法はありますか? 私が取り組んでいるアプリケーションには約 40 ~ 50 個の ListView があり、デザイナーですべての ListView を調べて「IsFooterVisible」を確認するのは不便です。言うまでもなく、新しく作成した ListView でフッターを表示したいと思います。

Windows UI に DevExpress XAF v 13.* を使用しています。

編集:

私がこれまでに持っているものは以下のとおりです。アクションの 1 つの ViewControlsCreated イベントで、フッターを表示しようとしました。

    private void SummarizeGridDataController_ViewControlsCreated(object sender, EventArgs e)
    {
        var listView = this.View as ListView;

        if (listView != null)
        {
            GridControl grid = (GridControl)View.Control;
            GridView view = (GridView)grid.FocusedView;
            view.OptionsView.GroupFooterShowMode = GroupFooterShowMode.VisibleAlways;
        }
    }
4

1 に答える 1

1

ListView に対して実行されるコントローラーを追加しました。コントロールが作成されたら、フッターの可視性を true に設定します。

    public partial class WinShowFooterController : ViewController<ListView>
{
    public WinShowFooterController()
    {
        InitializeComponent();
        RegisterActions(components);
        // Target required Views (via the TargetXXX properties) and create their Actions.
    }

    protected override void OnViewControlsCreated()
    {
        base.OnViewControlsCreated();
        // Access and customize the target View control.
    }

    protected override void OnActivated()
    {
        base.OnActivated();

        bool shouldSetFooterToVisible = this.View != null && this.View.Model != null;

        if (shouldSetFooterToVisible)
        {
            this.View.Model.IsFooterVisible = true;
        }
    }

    protected override void OnDeactivated()
    {
        base.OnDeactivated();
    }
}

上記のコードは、DevExpress サポート経由でヘルプから提供されました: https://www.devexpress.com/Support/Center/Question/Details/Q558578

于 2013-12-20T22:07:46.203 に答える