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 » CExtTreeGridWnd column reordering bug? Collapse All
Subject Author Date
Rado Manzela Feb 20, 2007 - 11:52 AM

It seems that column reordering using drag&drop causes that also column indexes used in ItemGetCell() are changed.
Call to ItemGetCell(x,1,....) gives another cell after column drag&drop to another place.
Is this by design or bug ?
I think column d&d should be transparent for ItemGetCell so I wouldn’t need to bother by column rearrangements made by user.
Thank you

Rado Manzela Feb 22, 2007 - 5:28 AM

So do I need to track column swapping in CExtTreeGridWnd and make my own coluns mapping?
I’d suggest you to implement this in future as part of all grid controls.
Thank you

Technical Support Feb 22, 2007 - 10:39 AM

You can use cell object pointers from the top outer row as unique column identifiers. In this case, we (or you) just need to implement only the one CellPointerToColumnIndex() method. This method could use a cached map of cell pointers to their column indixes and the cache could be updated automatically in the overridden CExtGridWnd::OnDataProviderSwapDroppedSeries() virtual method. But in the grid window, there can be many outer rows/columns at the left/top/right/bottom sides and the row/column swapping event will occur in two cases: drag-and-dropping outer cells and sorting (which is supported both horizontally and vertically). We think we should not implement the row/column-to-index mapping feature in the grid window to keep it working faster.





Technical Support Feb 22, 2007 - 4:24 AM

In both CExtTreeGridWnd and CExtGridWnd classes, plain indexes for accessing columns are used. If some columns were swapped, the column indexes get changed.

In the CExtReportGridWnd class, CExtReportGridColumn* pointers are used as unique column handles. This allows you to access grid cells in the report grid even if the column is inactive and not displayed in the report grid.