Show TOC

 GridDataLocate this document in the navigation structure

The GridData provides the layout data for a UI element in a container to which GridLayout is assigned. A grid layout defines a number of cells. In a grid layout cell, you can align a UI element both horizontally (left-justified, horizontally centered, right-justified, and so on) and vertically (top-aligned, vertically centered, bottom-aligned, and so on). The default setting for the alignment of the UI elements within the GridLayouts is left-justified and top-aligned.

Padding can be specified in two ways:

  • In the GridLayout using GridLayout.cellPadding
  • In the GridData using GridLayout.paddingLeft, or GridLayout.paddingRight, etc.

Both ways are possible. If you set the padding on the GridLayout, padding is set evenly on each cell, as shown in the figure in GridLayoutProperties sapurl_link_0001_0002_0026.

You can also specify padding on each cell. Paddings specified on GridLayouts and GridData are added up.

Runtime Class

CL_WD_GRID_DATA

Properties in the View Designer

Name Type Initial Value Bindable

id

STRING

(automatic)

No

cellBackgroundDesign

WDUI_CELL_BG_DESIGN

transparent

Yes

colSpan

I

1

No

dragData

STRING

No

height

STRING

No

hAlign

WDUI_CELL_HALIGN

beginOfLine

No

paddingBottom

STRING

No

paddingLeft

STRING

No

paddingRight

STRING

No

paddingTop

STRING

No

vAlign

WDUI_CELL_VALIGN

baseline

No

width

STRING

No

Note

Other properties that can be inherited are defined in the associated higher-level classes. The associated UI elements are:

Dynamic Programming

For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. Bear in mind the different spellings.

Dynamic Programming of Properties

View Designer Name Runtime Name Type

cellBackgroundDesign

CELL_BACKGROUND_DESIGN

WDUI_CELL_BG_DESIGN

 cellBackgroundDesign: border

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-BORDER

 cellBackgroundDesign: fill1

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-FILL1

 cellBackgroundDesign: fill2

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-FILL2

 cellBackgroundDesign: fill3

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-FILL3

 cellBackgroundDesign: header

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-HEADER

 cellBackgroundDesign: plain

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-PLAIN

 cellBackgroundDesign: transparent

CL_WD_GRID_DATA=>E_CELL_BACKGROUND_DESIGN-TRANSPARENT

colSpan

COL_SPAN

I

dragData

DRAG_DATA

STRING

height

HEIGHT

STRING

hAlign

H_ALIGN

WDUI_CELL_HALIGN

 hAlign: beginOfLine

CL_WD_GRID_DATA=>E_H_ALIGN-BEGIN_OF_LINE

 hAlign: center

CL_WD_GRID_DATA=>E_H_ALIGN-CENTER

 hAlign: char

CL_WD_GRID_DATA=>E_H_ALIGN-CHAR

 hAlign: endOfLine

CL_WD_GRID_DATA=>E_H_ALIGN-END_OF_LINE

 hAlign: forcedLeft

CL_WD_GRID_DATA=>E_H_ALIGN-FORCED_LEFT

 hAlign: forcedRight

CL_WD_GRID_DATA=>E_H_ALIGN-FORCED_RIGHT

 hAlign: justify

CL_WD_GRID_DATA=>E_H_ALIGN-JUSTIFY

paddingBottom

PADDING_BOTTOM

STRING

paddingLeft

PADDING_LEFT

STRING

paddingRight

PADDING_RIGHT

STRING

paddingTop

PADDING_TOP

STRING

vAlign

V_ALIGN

WDUI_CELL_VALIGN

 vAlign: baseline

CL_WD_GRID_DATA=>E_V_ALIGN-BASELINE

 vAlign: bottom

CL_WD_GRID_DATA=>E_V_ALIGN-BOTTOM

 vAlign: middle

CL_WD_GRID_DATA=>E_V_ALIGN-MIDDLE

 vAlign: top

CL_WD_GRID_DATA=>E_V_ALIGN-TOP

width

WIDTH

STRING