Skip to main content
.NET 6.0+

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.v23.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.v23.2.dll assembly to References.

The following code snippets (auto-collected from DevExpress Examples) contain references to the GridView property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

See Also