ComponentOne True DBGrid for .NET (2.0) Search HelpCentral 

Applying Pictures to Grid Elements

In earlier versions of True DBGrid, styles were used to specify font, color, and alignment attributes. This version extends the concept of styles to include background and foreground pictures, enabling adornments to be added to headers, footers, and caption bars, specify a background pattern for data cells, and render picture data in cells without having to populate a ValueItems object. The following properties of the Style object determine how pictures are displayed:

BackgroundImage

Sets/returns a style's background picture.

BackgroundPictureDrawMode

Controls how a style's background picture is displayed.

ForeGroundImage

Sets/returns a style's foreground picture.

ForegroundPicturePosition

Controls how a style's foreground picture is positioned.

Since picture properties follow the same inheritance rules as other style attributes, any technique described earlier in this chapter also works with pictures. This means that pictures can be attached to a grid element using any of the following methods:

·      Setting the BackgroundImage or ForeGroundImage property of a built-in named style in the designer or in code.

·      Setting the BackgroundImage or ForeGroundImage property of an anonymous style in the designer or in code.

·      Calling the AddCellStyle or AddRegexCellStyle method.

·      Writing a handler for the FetchCellStyle or FetchRowStyle event.


Displaying Background Pictures

Displaying Foreground Pictures


Send comments about this topic to ComponentOne.
Copyright © ComponentOne LLC. All rights reserved.