Print Page | Close Window

sort column to GroupBy area using API

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=13941
Printed Date: 29 September 2024 at 7:22pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: sort column to GroupBy area using API
Posted By: Bart6
Subject: sort column to GroupBy area using API
Date Posted: 07 April 2009 at 4:43am
Hello support

I would like to move my sort column to the GroupBy area using the API, but can currently only do it manually by dragging to column header into the GroupBy area.



I would like to end up in a situation where i can hide the GroupBy area, but have the columns sorted as seen on the right image.

Thanks so much
Bart




Replies:
Posted By: SuperMario
Date Posted: 08 April 2009 at 9:10am
Something like:

wndReportControl.GroupsOrder.Add wndReportControl.Columns(7)


Posted By: Bart6
Date Posted: 08 April 2009 at 10:20am
No really -
i already call

m_wndScenesGrid.GetColumns()->GetGroupsOrder()->Add(pColType, FALSE);

its sort the list, but it doesn't move the header to the GroupBy area.
 
thanks for reply
Bart


Posted By: inmaurik
Date Posted: 10 April 2009 at 6:17am
When you add it to the GetGroupsOrder() collection it stays visible in the grid. When you want to hide if from the Grid you will have to call pColType->SetVisible(FALSE).

In CXTPReportHeader::OnLButtonUp the column is hidden when the Control key is pressed or thwen the m_bHideColumnAfterGroupBoxDrop flag is TRUE:

// set grouping by
m_pColumns->GetGroupsOrder()->InsertAt(m_nDropIndex, pDragColumn);
bGroupOrderChanged = TRUE;

if ((m_bHideColumnAfterGroupBoxDrop && m_bDragHeader && ((nFlags & MK_CONTROL) == 0)) ||
     (!m_bHideColumnAfterGroupBoxDrop && m_bDragHeader && ((nFlags & MK_CONTROL) == MK_CONTROL)))
{
     pDragColumn->SetVisible(FALSE);
}
m_pControl->Populate();


-------------
Product: Xtreme SuitePro (MFC) version 13.3.1
Platform: Windows 7 Enterprise (64bit)
Language: C++ (Visual Studio 2008 SP1)


Posted By: Bart6
Date Posted: 12 April 2009 at 6:01am

Thanks Inmaurik! This worked.

(Bedankt)
Bart



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