Click here to Skip to main content
15,886,518 members
Articles / Desktop Programming / MFC

CListCtrl and Grouping Rows

Rate me:
Please Sign up or sign in to vote.
4.92/5 (38 votes)
27 Jul 2011CPOL3 min read 241.1K   8.7K   120  
Example of how to enable categories in the MFC list control
// ListCtrl_Category_GroupsDlg.h : header file
//

#pragma once
#include "afxcmn.h"

#include "CListCtrl_Category_Groups.h"
#include "CListCtrl_DataModel.h"


// CListCtrl_Category_GroupsDlg dialog
class CListCtrl_Category_GroupsDlg : public CDialog
{
// Construction
public:
	CListCtrl_Category_GroupsDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_LISTCTRL_CATEGORY_GROUPS_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
private:
	CListCtrl_Category_Groups m_ListCtrl;
	CListCtrl_DataModel m_DataModel;
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer
Denmark Denmark
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions