Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Objective Grid for Microsoft .NET User's Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

7.5 Advanced Topics

Internally, a hierarchical grid is implemented on top of a non-hierarchical grid, using covered cells and hidden rows. This is an efficient implementation approach, but it has a side effect: rows and columns are not numbered sequentially as they are when hierarchical mode is disabled. For example, when in hierarchical mode, the second logical row on your screen might actually be the fifth physical row with several hidden rows preceding it.

Logical cell coordinates must be transformed into physical cell coordinates before the grid can actually be accessed or altered. GridControl does the transformation for you. All API members expect logical cell coordinates and transform the arguments into physical cell coordinates. Additionally, overridden methods receive parameters already transformed into logical coordinates.

You will need to use physical coordinates directly or transform between logical and physical coordinate systems in two cases:

To specify physical coordinates, use the HgMap property.

7.5.1 The HgMap Property

The GridControl's HgMap property returns an interface to the Hierarchical Grid Mapper object, which manages the automatic transformation between logical and physical coordinates. Given the HgMap object, you can temporarily or permanently suspend the automatic transformations, and do the transformations manually instead. In addition, when executing overridden methods, the HgMap object gives you access to the original physical row and column arguments that apply to the current call context.

The object returned by the HgMap property is an instance of the HierGridMap class. The methods defined on this class follow:

Table 30: Methods of the HierGridMap Class

Method Description
Suspend Temporarily suspends automatic mapping of logical cell coordinates to physical.
Resume Following a Suspend, this method resumes the logical to physical mapping.
Enable Enables or disables the logical to physical transformations and cancels storage of current call physical row and column parameters.
LtoP.RowLtoP.ColLtoP.Range Converts a row, column, or range from logical to physical units.
PtoL.RowPtoL.ColPtoL.Range Converts a row, column, or range from physical to logical units.
RowRow2Row3 Retrieves the first, second, or third row parameter for the current call context. Typically, these methods are used from overridden methods to access the physical row parameters original passed.
ColCol2Col3 Retrieves the first, second, or third column parameter for the current call context.
Range Retrieves the range parameter for the current call context.

7.5.2 Using the HgMap Property

The expander column is skipped in column numbering, so it is not programmatically possible to expand the expander column without using the HgMap property. The following code resizes the expander column to 25 pixels:

The Suspend and Resume functions prevent automatic logical to physical coordinate mapping just for the SetColWidth call. If you need to override a function and specify a style for the expander column, you can do it as follows:



Previous fileTop of DocumentContentsNo linkNext file

Copyright © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo, and Stingray, are registered trademarks of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.