Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - sort column to GroupBy area using API
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

sort column to GroupBy area using API

 Post Reply Post Reply
Author
Message
Bart6 View Drop Down
Groupie
Groupie
Avatar

Joined: 22 March 2009
Location: Belgium
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bart6 Quote  Post ReplyReply Direct Link To This Post Topic: sort column to GroupBy area using API
    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

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 08 April 2009 at 9:10am
Something like:

wndReportControl.GroupsOrder.Add wndReportControl.Columns(7)
Back to Top
Bart6 View Drop Down
Groupie
Groupie
Avatar

Joined: 22 March 2009
Location: Belgium
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bart6 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
inmaurik View Drop Down
Groupie
Groupie


Joined: 13 July 2007
Location: Netherlands
Status: Offline
Points: 17
Post Options Post Options   Thanks (0) Thanks(0)   Quote inmaurik Quote  Post ReplyReply Direct Link To This Post 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)
Back to Top
Bart6 View Drop Down
Groupie
Groupie
Avatar

Joined: 22 March 2009
Location: Belgium
Status: Offline
Points: 20
Post Options Post Options   Thanks (0) Thanks(0)   Quote Bart6 Quote  Post ReplyReply Direct Link To This Post Posted: 12 April 2009 at 6:01am

Thanks Inmaurik! This worked.

(Bedankt)
Bart
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.141 seconds.