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
  [Expand]Data Grid
  [Collapse]Vertical Grid
   [Expand]Overview
   [Expand]Fundamentals
   [Collapse]Concepts
    [Expand]Layouts
    [Expand]Binding to Data
    [Expand]Rows
    [Expand]Records
    [Expand]Cells
    [Expand]In-place Editors
     Formatting
    [Expand]Appearances
     Hit Information
    [Expand]Custom Painting
    [Collapse]Alpha Blending and Background Images
      Apply Alpha Blending Using Appearances
      Apply Alpha Blending Using Custom Painting
    [Expand]Customization Form
     Batch Modifications
    [Expand]Drag and Drop
   [Expand]Visual Elements
   [Expand]Design-Time Features
   [Expand]Examples
   [Expand]End-User Capabilities
   [Expand]Member Tables
  [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

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.

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