Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Tree Column in Virtual Mode
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Tree Column in Virtual Mode

 Post Reply Post Reply
Author
Message
binkman71 View Drop Down
Newbie
Newbie


Joined: 22 July 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote binkman71 Quote  Post ReplyReply Direct Link To This Post Topic: Tree Column in Virtual Mode
    Posted: 22 July 2009 at 5:37pm
I have tried playing with the VirtualList example given for setting up a virtual mode Report Control.  While I can get the virtual mode to go, I can't get individual columns to actually...work.
 
If I add a checkbox to a column, clicking it checks every checkbox in that column.
 
If I use a tree column (this is true of the sample as it exists too), I cannot expand/collapse the tree nodes.
 
I am setting the checkboxes and tree mode in the override of CXTPReportRecord::GetItemMetrics as the example shows.  I am not setting the check state of the boxes, though, so similar to this:
 
void CMyVirtualRecord::GetItemMetrics(XTP_REPORTRECORDITEM_DRAWARGS* pDrawArgs, XTP_REPORTRECORDITEM_METRICS* pItemMetrics)
{
    CString strColumn = pDrawArgs->pColumn->GetCaption();
    int nIndexCol = pDrawArgs->pColumn->GetItemIndex();
    int nIndexRow = pDrawArgs->pRow->GetIndex();
    int nCount = pDrawArgs->pControl->GetRows()->GetCount();
    CXTPReportRecord* pRecord = pDrawArgs->pRow->GetRecord();
    switch( nIndexCol )
    {
    case 0:
        pItemMetrics->strText.Format( _T( "Item %d" ), nIndexRow );
        if( pRecord != NULL )
        {
            CXTPReportRecordItem* pItem = pRecord->GetItem( nIndexCol );
            if( pItem != NULL )
            {
                pItem->SetIconIndex( 0 );
                pItem->HasCheckbox( TRUE, FALSE );
            }
        }
        break;

What am I doing wrong, or what do I need to do to make buttons and tree nodes work??  Updating the VirtualList sample to make the tree nodes work would be extremely helpful.
 
Thanks,
 
K.
Back to Top
binkman71 View Drop Down
Newbie
Newbie


Joined: 22 July 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote binkman71 Quote  Post ReplyReply Direct Link To This Post Posted: 23 July 2009 at 11:20am
I got the check boxes working, still at a loss of tree node expanding/collapsing...
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 30 August 2009 at 2:56pm
Please check recent sample with multi-level tree in virtual mode - it also support click on expand/collapse button on tree - app should react on this click
 
 
Menu - Report - Tree...
Check status bar message while you click on Expand/Collapse button on tree
 
I can give you a sample code if you are interesting
Back to Top
markr View Drop Down
Senior Member
Senior Member


Joined: 01 August 2004
Status: Offline
Points: 430
Post Options Post Options   Thanks (0) Thanks(0)   Quote markr Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2009 at 12:48pm
I would be interested in the sample code that you offered.

Thanks for your time and consideration.
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2009 at 1:01pm
>>I got the check boxes working, still at a loss of tree node expanding/collapsing...
You need to support it on your app level - control have no ideas about your virtual records
Back to Top
mdoubson View Drop Down
Senior Member
Senior Member
Avatar

Joined: 17 November 2008
Status: Offline
Points: 1705
Post Options Post Options   Thanks (0) Thanks(0)   Quote mdoubson Quote  Post ReplyReply Direct Link To This Post Posted: 31 August 2009 at 1:24pm
This is a requsted sample - you need to use m_lstCollapsed if you want support proper reaction on virtual row checkbox click
 
Back to Top
fjosesen View Drop Down
Groupie
Groupie
Avatar

Joined: 30 June 2008
Status: Offline
Points: 46
Post Options Post Options   Thanks (0) Thanks(0)   Quote fjosesen Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 4:13pm
I think the same than Mark. When using virtual tree mode, the hosting app should manage the hierarchy and handle the expanding/collapsing events.
 
Welcome to the virtual world! Too fast and too fool!
 
FJSen
Products: Suite Pro (ActiveX) v18.0.1
          Toolkit Pro (MFC) v18.0.1
Platform: Windows 10 (64bit)
Language: VC++ 2013 (MFC)
Back to Top
binkman71 View Drop Down
Newbie
Newbie


Joined: 22 July 2009
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote binkman71 Quote  Post ReplyReply Direct Link To This Post Posted: 01 September 2009 at 4:34pm
Thanks Mark.  I'll be examining the code you provided!  It should, at the very least, be a good jumping off point.
 
And I do realize I'd have to support things on the data end.  But, that said, in the past when I've used controls with virtual modes in them, the control requested display items one at a time (but they didn't contain trees).  So if you had a tree like this:
 
Row0
  |-----Row1
  |-----Row2
Row3
  |-----Row4
  |        |------Row5
  |-----Row6
 
And you collapsed Row 4, the control would ask (one at a time, via a list, etc.) for the records for Rows 0,1,2,3,4,and 6 to display.  If Row 0 was then collapsed, it would ask for 0, 3, 4, and 6 [in this extrememly simple example].  This would be my ideal for a control of this nature; mind you I don't know if such a thing exists.  Just saying this is what I was hoping for. :)
 
K.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.047 seconds.