[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
  [Expand]Data Grid
  [Collapse]Vertical Grid
   [Expand]Binding to Data
   [Expand]Data Layout: Records, Rows and Cells
   [Expand]Data Editing and Validation
    Formatting Values
   [Expand]Drag and Drop
   [Collapse]Appearance and Custom Painting
    [Expand]Custom Painting
    [Collapse]Alpha Blending and Background Images
      Apply Alpha Blending Using Appearances
      Apply Alpha Blending Using Custom Painting
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]End-User Capabilities
    Hit Information
    Batch Modifications
   [Expand]Member Tables
  [Expand]Property Grid
  [Expand]Pivot Grid
  [Expand]Tree List
  [Expand]Gantt Control
  [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)

Apply Alpha Blending Using Appearances

The Alpha Blending feature allows you to enhance the appearance of a vertical 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 vertical grid elements.

Expanded Appearances and Alpha Blending

The vertical grid controls (VGridControl and PropertyGridControl) allow you to customize the appearance of the following.

Appearances are represented by AppearanceObject objects, which provide a number of properties that affect the appearance of grid elements. When alpha blending is implemented, only the properties that specify the background colors and gradient mode are used (the AppearanceObject.BackColor, AppearanceObject.BackColor2 and AppearanceObject.GradientMode properties). The BackColor and BackColor2 properties specify the starting and ending colors of the gradient that fills the element's background. The GradientMode property specifies the gradient direction.

There are two possible situations when setting an element's background:

Expanded Example

This example shows how to set the transparency for row headers and empty space within a VGridControl. As a result, the vertical grid's background image will be partially visible.

Follow the steps below.

  1. Select the control to display its properties within the Properties window and assign an image to its BackgroundImage property.

  2. Invoke the VerticalGrid Designer and switch to the Appearances page.
  3. Select the Empty appearance in the Appearances list and set its BackColor property to Transparent. This will make the vertical grid's background image visible in the control area that is not occupied by any elements.

  4. Select the RowHeaderPanel item in the Appearances list (this appearance item corresponds to non-focused row headers) and set its background color to a semi-transparent color: (150, 209, 157, 139).

  5. Select the FocusedRow item in the Appearances list (this appearance item corresponds to the focused row header) and set its background color to another semi-transparent color: (150, 255, 177, 179).

  6. Run the application. The image below shows the result.


Runtime Example

All of the above can also be done via code, as shown in the sample code below. The code is enclosed in calls to the VGridControlBase.BeginUpdate and VGridControlBase.EndUpdate methods to prevent the vertical grid from being updated numerous times.

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