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

Customizing Appearances of Individual Columns, Card Fields and Bands

The appearances provided by a View give you the ability to specify how the View's elements of a particular type (headers, cells, footer, etc.) are painted. But there may be situations in which different appearances need to be provided for elements of the same type. This topic describes how to assign appearances to data cells within individual columns and how to provide custom appearances for individual band and column headers. For general information on appearances, see the Appearances Overview document.

Expanded Online Video

Learn how to customize the appearance of Views and individual columns and how to change the View's paint style so that you can customize theme-drawn elements.

Expanded Customizing the Appearances of Cells Within Individual Columns

By default, the data cells within Views are painted using the appearance settings provided by a View. This allows a common appearance for all the data cells and for the cells displayed within the focused and selected rows to be specified. Grid Views additionally allow you to specify different appearances for the cells displayed within even and odd rows.

There may be cases however, when such appearance customization isn't enough. For instance, you may need to provide different appearances for the cells displayed within different columns. To do this, use the column's GridColumn.AppearanceCell property. This property returns the AppearanceObjectEx object, which provides the appearance settings used to paint the column's cells.

By default these appearance settings take priority only over the View's appearances, which are used to paint the cells within the regular and selected rows. They are overridden by the View's appearances, which are used to paint the focused row and focused cell. To make the custom appearance settings for column cells have a higher priority so that they override the View's appearances for the focused row and focused cell you should set the AppearanceOptionsEx.HighPriority option to true.

The following sample shows how to provide custom appearance settings for the cells within a column at design time. The Grid View's initial appearance is shown in the image below.

Follow the steps below.

  • The appearance of column cells can be changed in a number of ways. The image below shows how this can be done using the Grid Designer.

  • Run the application. The grid control will look like the image displayed below.

You can also customize the appearance of column cells without invoking the Grid Designer. To do this, click the desired column's header to display the column's settings within the Properties window and customize the appearance settings provided by the GridColumn.AppearanceCell property.

All of the above can be implemented programmatically as follows.

Expanded Customizing the Appearances of Individual Card Fields

For Card View, the technique of specifying custom appearances to individual card fields is the same as that described above. The following image shows a Card View with different appearances applied to the Name and Description card fields.

Expanded Customizing the Appearances of Individual Column and Band Headers

Custom appearances can also be assigned to individual column and band headers. This technique is similar to the one described above. To specify the appearance settings used to paint an individual column header, use the column's GridColumn.AppearanceHeader property. The analogue for bands is the GridBand.AppearanceHeader property.

The image below shows a Grid View where the text of two column headers are painted in bold and using a custom foreground color.

Note

When the View is painted using the Windows XP, Office2003 or Skin style the appearance settings used to paint the header's background are not in effect.

Expanded See Also

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