[Expand]General Information
[Collapse]WinForms Controls
  .NET Core Support
 [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]Get Started With Data Grid and Views
   [Expand]Data Binding
    Unbound Columns
   [Expand]Data Editing and Validation
   [Expand]Filter and Search
   [Expand]Focus and Selection Handling
    Format Cell Values
   [Expand]Master-Detail Relationships
   [Expand]Asynchronous Image Load
   [Expand]Export and Printing
   [Collapse]Appearance and Conditional Formatting
    [Expand]Custom Painting
    [Collapse]Alpha Blending and Background Images
      Implement Alpha Blending Using Appearances
      Implement Alpha Blending Using Custom Painting
    Split Presentation
    Row Preview Sections
   [Expand]Batch Modifications
    Hit Information
    Popup Menus
   [Expand]Save and Restore Layout
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Included Components
  [Expand]Vertical Grid
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Chart Control
  [Expand]Map Control
  [Expand]Rich Text Editor
  [Expand]Spell Checker
  [Expand]Form Layout Managers
  [Expand]Navigation Controls
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Sunburst 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]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Implement Alpha Blending Using Appearances

The alpha blending feature enables you to enhance the appearance of a grid control by painting its elements using transparent brushes and pens. This topic explains how to implement the alpha blending feature by customizing the appearance settings used to paint the grid elements.

Expanded Appearances and Alpha Blending

The GridControl provides advanced appearance technology that can be used to customize the appearance of the following.

  • View elements of a particular type. For instance, you can change the appearance of column headers, indicator cells, preview sections, etc.
  • Cells in an individual column. See the Appearance and Conditional Formatting topic for additional information.
  • Individual cells. The ways in which this can be done are described in the Appearance and Conditional Formatting topic.

Appearances are represented by the AppearanceObject objects that provide a number of properties that affect the appearance of View elements. When implementing alpha blending, only properties that specify the background and foreground colors are used (the AppearanceObject.BackColor, AppearanceObject.BackColor2 and AppearanceObject.ForeColor properties). The first two properties specify the starting and ending colors of the gradient that fills an element's background. The AppearanceObject.ForeColor property specifies the color of the text.

Note that there are two possible situations when setting an element's background.


Specific view elements do not allow you to change their background in specific paint themes. For instance, the background of the Group Panel cannot be modified when any skin or the Office2003 paint theme is applied.

Expanded Example of Implementing Alpha Blending Using Appearances

This example shows how to set the transparency of GridControl's empty space and the group panels at design time. As a result, the grid's background image will be partially visible.

Follow the steps below.

  1. Select the grid control to display its properties within the Properties window and assign an image to its BackgroundImage property.
  2. Invoke the Grid Designer and switch to the Appearances page. Set the Paint Style setting to Flat.

  3. Select the Empty appearance and set its background color to Transparent, as shown in the image below. This will make the grid's background image visible in the View area that is not occupied by any elements.

  4. Select the GroupPanel appearance and change its background color value to (100, 22, 69, 145).

  5. Run the application.


All of the above can also be performed via code as shown in the sample code below. The code is enclosed in calls to the BaseView.BeginUpdate and BaseView.EndUpdate methods, to prevent the control from being updated multiple times.

The Appearances page of the Grid Designer provides you with design-time facilities not only for modifying the appearance layouts, but also to save or load them. At runtime, the appearance layout can be saved and then restored 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. For general information on appearances, see the Appearance and Conditional Formatting document.

Expanded See Also

Is this topic helpful?​​​​​​​