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]Binding to Data
   [Expand]Grid View
   [Expand]View Technology
   [Expand]Grouping
   [Expand]Sorting
   [Expand]Summaries
   [Expand]Data Editing
   [Expand]Filtering and Locating Rows
   [Expand]Focus and Selection Handling
   [Expand]Processing Rows
   [Expand]Formatting Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Collapse]Appearance and Conditional Formatting
    [Expand]Look and Feel
    [Collapse]Appearances
      Appearances Overview
      Tutorial: Custom Styles for Rows and Cells
      Tutorial: View and Column Appearance
      Customizing Appearances of Individual Columns, Card Fields and Bands
      Customizing Appearances of Individual Rows and Cells
      Style Schemes
    [Expand]Conditional Formats
    [Expand]Custom Painting
    [Expand]Alpha Blending and Background Images
   [Expand]Batch Modifications
   [Expand]Hit Information
   [Expand]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]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]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Style Schemes

Grid Control enables you to change the appearance of all its elements at once. This can be done by applying a style scheme to the control. A style scheme is a set of appearances for all the elements within a View. There are two types of style schemes: predefined (style formats) and manually created style schemes (appearance layouts). This topic describes how to use both. For general information about styles, see the Appearances Overview topic.

Expanded Using Style Formats

Applying a style scheme to a control means modifying predefined appearances provided by the View's BaseView.Appearance property.

The Style Schemes page of the Grid Designer provides design-time facilities to apply style schemes to Views and to change their paint styles. Note that this page is not available if the Grid Control is painted by using a DevExpress skin. There are forty four predefined style schemes that can be applied to Views.

Style schemes can be applied at runtime as well. You must use the LoadScheme method of the DevExpress.XtraGrid.Design.XAppearances object for this purpose. This method takes two parameters. The first parameter is a string that specifies the desired style scheme's name. The second parameter takes the View to which the style scheme is to be applied.

The following sample code shows how to load the Pastel#1 style scheme.

The image below shows the result.

Note: you can obtain all the names of the style schemes using the FormatNames property of the DevExpress.XtraGrid.Design.XAppearances object.

Expanded Using Appearance Layouts

You can also create style schemes (appearance layouts) manually. This means that you can customize the appearance settings used to paint View elements and then save them to an XML file. Once saved, these settings can then be restored when needed.

The Appearances page of the Grid Designer provides you with design-time facilities to modify and save/load appearance layouts. This page is shown in the image below.

Appearance layouts can also be saved and then restored at runtime using the methods provided by the BaseAppearanceCollection class. This allows the appearance settings to be saved to the system registry, a stream or an XML file. The code below shows how to save and restore the Grid View's appearance layout to/from an XML file.

Expanded See Also

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