Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Collapse]WinForms Controls
  Prerequisites
 [Expand]What's Installed
 [Expand]Build an Application
 [Collapse]Controls and Libraries
  [Expand]Forms and User Controls
  [Expand]Messages, Notifications and Dialogs
  [Expand]Editors and Simple Controls
  [Expand]Ribbon, Bars and Menu
  [Expand]Application UI Manager
  [Expand]Docking Library
  [Collapse]Data Grid
   [Expand]Getting Started
   [Expand]Data Binding
   [Collapse]Views
    [Expand]Grid View
     Banded Grid Views
    [Expand]Card and Layout Views
     WinExplorer View
    [Expand]Tile View
   [Expand]Data Editing and Validation
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Filter and Search
   [Expand]Summaries
   [Expand]Focus and Selection Handling
    Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Expand]Appearance and Conditional Formatting
    Split Presentation
    Row Preview Sections
    Scrolling
   [Expand]Batch Modifications
   [Expand]Hit Information
    Hints
   [Expand]Popup Menus
   [Expand]Saving and Restoring Layouts
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Diagrams
  [Expand]Gauges
  [Expand]Map Control
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]Printing-Exporting
  [Expand]PDF Viewer
   Reporting
  [Expand]Snap
  [Expand]TreeMap Control
 [Expand]Common Features
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Views

This document contains advanced technical information on Data Grid Views. To learn what Views are and how to change them, refer to the Getting Started article.

Expanded Object Hierarchy

All Grid Views derive from the abstract BaseView class (which declares virtual methods to work with editors, appearances, hints, details and saving and restoring layouts) and its descendant, an abstract ColumnView class (which introduces methods to work with columns and rows/records). Other classes are not abstract and you create their instances, each representing a separate Data Grid View.

Expanded View Repository and Switching Between Views

The Level Designer allows you to create Views in addition to the default GridView. The Data Grid automatically adds them to the GridControl.ViewCollection collection.

To create View instances in code, populate the GridControl.ViewCollection manually. Note the difference between this and the GridControl.Views collections: ViewCollection holds all Views owned by a control, while Views contains only currently visible ones (main View and detail Views). You can also add new Views by calling the GridControl.CreateView method.

The View Repository page of the Data Grid Designer allows you to quickly navigate through Views and change their settings.

To apply a Data Grid View at runtime, assign it to the GridControl.MainView property. Note that certain Views require additional customization before they can display data. For example, a TileView requires that you set up the TileView.ColumnSet collection first.

You can also use the GridControl.MainView property to access a currently applied View and retrieve/modify its settings.

The code above works with any View since the "ViewCaption" property is defined in the root BaseView class. If you need to access View-specific settings, you must cast types first.

Remember that you can always access a View directly by its name.

Expanded Custom Views

If you frequently need to create Views with custom behavior or a specific set of settings, you can simplify your task by creating a descendant View type. The Template Gallery provides the "Custom Data Grid" template to quickly create View descendants along with required infrastructure classes.

Expanded See Also

How would you rate this topic?​​​​​​​