Consultor Eletrônico



Kbase P168921: How to force the ultraGrid to merge consecutive cells that share the same values
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   29/06/2010
Status: Unverified

GOAL:

How to force the ultraGrid to merge consecutive cells that share the same values

GOAL:

How to override MergedCellStyle property in the UltraGrid

GOAL:

How to access Infragistics.Win.UltraWinGrid.MergedCellStyle property

GOAL:

How to override MergedCellContentArea property in the UltraGrid

GOAL:

How to access Infragistics.Win.UltraWinGrid.MergedCellContentArea property

FACT(s) (Environment):

Windows
OpenEdge 10.2x

FIX:

The MergedCellStyle and MergedCellContentArea properties control when multiple cells of a column in the UltraGrid that share the same value will be visibly merged in the column and how they will be displayed. These properties are enumerations and each are defined, with use cases, below:

The Infragistics.Win.UltraWinGrid.MergedCellStyle enumeration controls when to merge cells in the grid and contains the following four values/data members:

- Default - Resolves to the default behavior which is Never
- Always - Contiguous cells with shared values are always merged
- OnlyWhenSorted - Merge cells only for the sort column
- Never - Never merge cells

The Infragistics.Win.UltraWinGrid.MergedCellContentArea enumeration controls how many cells are merged, i.e. only visible cells or all contiguous cells with the same value, even when they're out of the visible area. This property contains the following three values/data members:

- Default - The default value is VirtualRect
- VirtualRect - This merges all contiguous cells with the same value even if they are out of the visible area
- VisibleRect - This merges only cells which are visible and that are contiguous and share the same value

Examples:
/* All contiguous cells with the same value will be merged, regardless of whether the column is sorted or not */
ultraGrid1:DisplayLayout:Override:MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle:Always.

/* Only visible cells will be merged */
ultraGrid1:DisplayLayout:Override:MergedCellContentArea = Infragistics.Win.UltraWinGrid.MergedCellContentArea:VisibleRect.

/* Merging is only applied to the sort column */
ultraGrid1:DisplayLayout:Override:MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle:OnlyWhenSorted.

/* Cells are never merged */
ultraGrid1:DisplayLayout:Override:MergedCellStyle = Infragistics.Win.UltraWinGrid.MergedCellStyle:Never. /* or :Default */

/* All contiguous cells with the same value in a given column will be merged... Even those outside the visible area */
ultraGrid1:DisplayLayout:Override:MergedCellContentArea = Infragistics.Win.UltraWinGrid.MergedCellContentArea:VirtualRect. /* or Default */