Print Page | Close Window

Tree Column in Virtual Mode

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Report Control
Forum Description: Topics Related to Codejock Report Control
URL: http://forum.codejock.com/forum_posts.asp?TID=14795
Printed Date: 16 May 2022 at 8:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Tree Column in Virtual Mode
Posted By: binkman71
Subject: Tree Column in Virtual Mode
Date 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.



Replies:
Posted By: binkman71
Date Posted: 23 July 2009 at 11:20am
I got the check boxes working, still at a loss of tree node expanding/collapsing...


Posted By: mdoubson
Date 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
 
https://forum.codejock.com/uploads/DemoVersion/EditVirtualListIconStatic.rar - https://forum.codejock.com/uploads/DemoVersion/EditVirtualListIconStatic.rar
 
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


-------------
Mark Doubson, Ph.D.


Posted By: markr
Date Posted: 31 August 2009 at 12:48pm
I would be interested in the sample code that you offered.

Thanks for your time and consideration.


Posted By: mdoubson
Date 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

-------------
Mark Doubson, Ph.D.


Posted By: mdoubson
Date 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
 
http://forum.codejock.com/uploads/20090831_132513_VirtualTestForF.rar - uploads/20090831_132513_VirtualTestForF.rar


-------------
Mark Doubson, Ph.D.


Posted By: fjosesen
Date 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)


Posted By: binkman71
Date 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.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net