Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Can I Force a Column to be Grouped?
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Can I Force a Column to be Grouped?

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


Joined: 12 December 2005
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote EricM Quote  Post ReplyReply Direct Link To This Post Topic: Can I Force a Column to be Grouped?
    Posted: 12 December 2005 at 8:31pm

Is it possible to force a specific column to be grouped?  I can "suggest" that the column be grouped using the following code:

{

CXTPReportColumn *pColumn = m_wndReport.AddColumn(new CXTPReportColumn(0, _T("Test Column"), 50));

CXTPReportColumns *pColumns = m_wndReport.GetColumns();

CXTPReportColumnOrder *pColumnOrder = pColumns->GetGroupsOrder();

pColumnOrder->InsertAt(0, pColumn);

pColumn->SetVisible(FALSE);

}

But doing this only starts the control off with the grouping, it doesn't deny users from subsequently removing the grouping.  Can I turn off the ability to remove just this column from the grouping.  (i could turn it all off by hiding the GroupBy header, but I don't want to do that).

Thanks,

E

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 13 December 2005 at 4:44pm
Hi Eric,

See ReportColumn methods Set(Is)Groupable, Set(Is)Sortable. They could probably help you.

Also, if you’re adding a custom column which is derived from standard CXTPReportColumn, you can set the internal member m_bAllowDrag to FALSE for this column. It will prevent it from being dragged from the Group By header. But note that it would also prevent it from being dragged from its place on the Report header.

--
WBR,
Serge
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.187 seconds.