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 » Walking items in ReportGrid Collapse All
Subject Author Date
Suhai Gyorgy Sep 20, 2007 - 6:30 AM

Dear Support,

In August there was a thread Walking data in the CExtReportGridWnd control. In it a kind of bug was described concerning CExtTreeGridWnd::ItemGetNext method. As the poster described, with a little more coding it is possible to solve the problem, but I’d need proper functioning of ItemGetPrev now.

I need to implement Search function in our ReportGrid so I need to be able to step up/down one item in the grid, and if a match is found, I need to make the item visible (expanded) if it wasn’t so before. Have you fixed ItemGetNext/ItemGetPrev to be able to step through all items (visible or not, expanded or not, first/last child of an inner item or not)?

Thank you very much!

Technical Support Sep 23, 2007 - 1:27 PM

We did some refactoring with regard to the ItemGetNext() and ItemGetPrev() methods (they were initially designed for internal use):

      virtual HTREEITEM ItemGetNext(
            HTREEITEM hTreeItem,
            bool bSiblingOnly,
            bool bExpandedWalk,
            bool bIncludeHidden
            ) const;
      virtual HTREEITEM ItemGetPrev(
            HTREEITEM hTreeItem,
            bool bSiblingOnly,
            bool bExpandedWalk,
            bool bIncludeHidden
            ) const;
The bIncludeHidden parameter allows you to skip hidden tree items. Hidden columns, rows and tree items have been implemented recently (after 2.80). The bSiblingOnly parameter allows you to enumerate only sibling items if it set to true ( bExpandedWalk is ignored in this case). The bExpandedWalk parameter allows you to skip tree items that have collapsed parent items if it set to true. The updated methods are tested and demonstrated in a new version of the TestTreeItemWalk test project. Please also download the updated source code of Prof-UIS from our ftp server.

Suhai Gyorgy Sep 24, 2007 - 4:19 AM

Works as needed now, thank you very much!

Technical Support Sep 21, 2007 - 11:00 AM

We created a test application to check the execution of the CExtTreeGridWnd::ItemGetNext() and CExtTreeGridWnd::ItemGetPrev() methods with all the possible combinations of their parameters. It allows to walk through tree items forward and backward starting from the focused item. Could you tell us what should be improved exactly using this application as a starting point?

Suhai Gyorgy Sep 21, 2007 - 1:18 PM

What I’d like to achieve is to get the numbers 0, 1, 2, 3, ..., 20, all in an increasing order in the list on the right. But this should happen in any state of the grid ( even if all items are closed and only 0, 7 and 14 can be seen ). No matter what flags I try to set in ItemGetNext, I can’t get this.
And of course ItemGetPrev should result in 20, 19, 18, ..., 0.