Column-Spanning Grid DataWindow Headings

More
7 months 2 weeks ago #499 by John Fauss
John Fauss created the code: Column-Spanning Grid DataWindow Headings
Have you ever wanted to include a title or other heading-type information at the top of a grid DataWindow, but got frustrated because the grid presentation style forces you to stay within the width of a single column? This example application will show you how you can implement a flexible and adaptable column-spanning heading to a grid DataWindow.
Features of the Grid Heading example application:
  • Supports text longer than the normal limitation of 250 characters in a text DataWindow object, across multiple lines if needed.
  • Occupies the entire grid width of the grid columns or the available width in the DataWindow control and responds to user-driven changes in these values.
  • Automatically adjusts the vertical placement of text column headings and other Heading band objects.
  • A grid presentation-style Data Object can be swapped/replaced by another while the grid heading is being displayed.
  • Ensures a minimum of two Detail band rows are visible, disabling the grid heading if it occupies too much space in the DataWindow control. This threshold is configurable.
  • Works with themes (in version PB 2019 or later.)
  • Successfully handles text containing tildes (~), apostrophes (‘) and quotation marks (“).
The Grid Heading example window in the application permits you to specify:
  • The text to be displayed in the grid heading. The app provides four pre-defined examples.
  • Automatic insertion of intelligent line breaks based on rules you specify, if needed.
  • Automatic calculation of grid heading height based on the text and the grid heading display properties. However, the grid heading height can be fixed, if needed.
  • Left, Center, or Right alignment of the grid heading text.
  • Grid presentation-style DataWindows that use any units of measurement (PowerBuilder Units, Pixels, 1/1000th Inch, 1/1000th Centimeter).
  • The font typeface, point size, color, weight (normal/bold), italics, and underline properties for the grid heading.
  • The color of a gradient background (solely to illustrate the possible use of gradients in the grid heading). The gradient background is automatically disabled when a theme is in use.
A minimal amount of code in the window and DataWindow control is needed. Most of the code resides in non-visual objects (NVO’s). The code in all objects is generously commented.

This message has an attachment file.
Please log in or register to see it.

Please Log in or Create an account to join the conversation.

Moderators: Appeon Administrator