Footerzeile in allen ListViews anzeigen


Dies lässt sich über einen ViewController mit wenigen Zeilen realisieren. Erstelle dazu in Deinem XAF Projekt im Module Win Projekt einen Controller und füge in das Event „OnViewControlsCreated“ folgenden Code hinzu:

base.OnViewControlsCreated();
  protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            // Access and customize the target View control.
            _listEditor = ((ListView)View).Editor as GridListEditor;
            if (_listEditor == null)
                return;
            _listEditor.GridView.OptionsView.ShowFooter = true;

        }

Gesamter Code des Controllers:

using System;
using System.Collections.Generic;
using System.Linq;
using DevExpress.ExpressApp;

using DevExpress.ExpressApp.Win.Editors;

namespace GISV2.Module.Win.Controllers
{
    // For more typical usage scenarios, be sure to check out https://documentation.devexpress.com/eXpressAppFramework/clsDevExpressExpressAppViewControllertopic.aspx.
    public partial class ListViewAlwaysShowFooter_Controller : ViewController
    {
        GridListEditor _listEditor;
        public ListViewAlwaysShowFooter_Controller()
        {
            InitializeComponent();
            // Target required Views (via the TargetXXX properties) and create their Actions.
        }
        protected override void OnActivated()
        {
            base.OnActivated();
            // Perform various tasks depending on the target View.
        }
        protected override void OnViewControlsCreated()
        {
            base.OnViewControlsCreated();
            // Access and customize the target View control.
            _listEditor = ((ListView)View).Editor as GridListEditor;
            if (_listEditor == null)
                return;
            _listEditor.GridView.OptionsView.ShowFooter = true;

        }
        protected override void OnDeactivated()
        {
            // Unsubscribe from previously subscribed events and release other references and resources.
            base.OnDeactivated();
        }
    }
}

Schreibe einen Kommentar