Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » item order in ReportGrid Collapse All
Subject Author Date
David Skok Jun 6, 2008 - 9:37 AM

I use a report grid in my app where no grouping is enabled.  How can I change the order in which items are displayed?  I am not talking about sorting by ascending/descending, I’m talking custom ordering.


For simplicity in explaining what I want to do...


lets say items originally inserted as follows:


1


2


3


later I want order changed to:


1


3


2


How can I do it.

Technical Support Jun 6, 2008 - 1:30 PM

The CExtReportGridWnd class is derived from CExtTreeGridWnd. You can work with the report grid control as though it is a tree grid control. CExtReportGridItem* pointers in fact are HTREEITEM handles. The CExtTreeGridWnd::ItemCopyMove() method can be used for moving report/tree grid rows. It can be used for cloning rows in the CExtTreeGridWnd control. But it cannot be used for cloning rows in the CExtReportGridWnd control. The CExtTreeGridWnd::ItemCopyMoveTest() method can be used for detecting whether the tree row can be moved into a new position (you don’t need this method in a plain report grid).

Generally the CExtReportGridWnd class uses CExtReportGridItem* pointers as unique row identifiers and does not define the order of items. The registered report items are simply added to the bottom.

David Skok Jun 25, 2008 - 6:57 AM

On a similar note, is it possible to use ItemInsert to insert items into ReportGrid in desired order as they are created?

Technical Support Jun 26, 2008 - 5:30 AM

A report grid is a really tree grid. But in a tree grid and in a tree common control you typically see a very different layout of tree brunches. In a report grid tree brunches always have the same nested level. Besides, only the bottom level tree rows in a report grid are displayed as data rows with columns in grid cells because other rows are automatically assumed to be group rows. All the grid classes operate with the same grid cell classes. If you don’t need the report grid as it is, then you can switch to a tree grid.