Skip to main content
A newer version of this page is available. .
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.

GridListEditor.GridView Property

Provides access to the Grid Control’s View that is used to display data in the GridListEditor.

Namespace: DevExpress.ExpressApp.Win.Editors

Assembly: DevExpress.ExpressApp.Win.v21.2.dll

NuGet Package: DevExpress.ExpressApp.Win

Declaration

public GridView GridView { get; }

Property Value

Type Description
GridView

A GridView object that is the GridControl‘s View used to display data in the GridListEditor.

Remarks

The GridListEditor uses the GridControl as its control. The GridControl displays data in a UI via special Views. Note, that these Views are not related to the Views used in XAF to construct a UI. The GridControl‘s Views are represented by the GridView class instances. The GridView class provides a two-dimensional representation of data from a data source in grid format.

The example below demonstrates how to set the alternating row color for all List Views in a WinForms application.

using System;
using System.Drawing;
using DevExpress.ExpressApp;
using DevExpress.ExpressApp.Win.Editors;
// ...
public class ListEditorController : ViewController<ListView> {
    private GridListEditor listEditor;
    private void ListEditor_ControlsCreated(object sender, EventArgs e) {
        DevExpress.XtraGrid.Views.Grid.GridView gridView = ((GridListEditor)View.Editor).GridView;
        gridView.OptionsView.EnableAppearanceOddRow = true;
        gridView.Appearance.OddRow.BackColor = Color.FromArgb(244, 244, 244);
    }
    protected override void OnActivated() {
        base.OnActivated();
        listEditor = View.Editor as GridListEditor;
        if (listEditor != null) {
            listEditor.ControlsCreated += ListEditor_ControlsCreated;
        }
    }
    protected override void OnDeactivated() {
        if(listEditor != null) {
            listEditor.ControlsCreated -= ListEditor_ControlsCreated;
        }
        base.OnDeactivated();
    }
}

Note

To run this code, add the DevExpress.ExpressApp.XtraGrid.v21.2.dll assembly to References.

See Also