Question

Is there a way to make the footer automatically visible on a ListView? The application I'm working on has around 40-50 ListViews, and it's inconvenient to go through every ListView in the designer and check "IsFooterVisible". Not to mention that I'd like newly created ListView's to show the footer.

I'm using DevExpress XAF v 13.* for Windows UI.

Edit:

What I have so far is seen below. On the ViewControlsCreated event of one of my actions, I attempt to make the footer visible:

    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;
        }
    }
Était-ce utile?

La solution

I added a controller that is ran for a ListView. When the controls are created, I set the footer visibility to 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();
    }
}

The code above was provided from help via DevExpress Support: https://www.devexpress.com/Support/Center/Question/Details/Q558578

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top