Click here to Skip to main content
11,803,019 members (77,285 online)
Click here to Skip to main content

The Grid Control

, , , , 5 Jun 2000 CPOL 387.2K 184
Rate this:
Please Sign up or sign in to vote.
The grid is a fully featured control for displaying tabular data. There are MFC and ATL versions that run on everything from CE to Windows 2000
<!-- Article Starts -->


After pushing the CListCtrl to its limits in trying to display and edit tabulated data I decided what was really needed was a dedicated grid control. I started writing my own grid control from scratch but decided to save time by modifying Joe Willcoxson's free WorldCom grid control. I tore apert his code and rebuilt it from the ground up in order to get it to do all the things I needed. The code has gone through so many modifications that I'm not sure if there is even a single original line of code. In any case Joe's code was a great framework on which to build.

Since the initial release at the beginning of 1998 there have been many, many versions of the grid - some better than others. There have also been ports to CE, an ATL version, and extensions that include a tree-list control.

The list of all those who have contributed and provided fixes, bug reports and suggestions is too huge to mention - thanks everyone!

The Grid Control articles and projects

The Grid

MFC Grid control - Chris Maunder
A fully featured grid control for displaying tabular data that is derived from CWnd

Plug-in cell types

Tree control and Buttons for MFC Grid control - Ken Bertelson
A set of classes derived from CGridCtrl that embed a tree control, button controls, and virtual cells within the grid

Using comboboxes in the MFC Grid Control - Chris Maunder
Explains how to use comboboxes to edit cells in the MFC Grid Control

Adding Hyperlink support to the MFC Grid Control - Fred Ackers and Chris Maunder
A new class that adds hyperlink support to the MFC Grid Control

Using the Grid

Using the Grid Control in a Doc/View framework - Chris Maunder
A simple tutorial that demonstrates how to use the grid control in a doc/view application.

ActiveX version

ATL Grid control - Mario Zucca
A grid control for displaying tabular data, based on Chris Maunder's grid control


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


About the Authors

Chris Maunder
Founder CodeProject
Canada Canada
Chris is the Co-founder, Administrator, Architect, Chief Editor and Shameless Hack who wrote and runs The Code Project. He's been programming since 1988 while pretending to be, in various guises, an astrophysicist, mathematician, physicist, hydrologist, geomorphologist, defence intelligence researcher and then, when all that got a bit rough on the nerves, a web developer. He is a Microsoft Visual C++ MVP both globally and for Canada locally.

His programming experience includes C/C++, C#, SQL, MFC, ASP, ASP.NET, and far, far too much FORTRAN. He has worked on PocketPCs, AIX mainframes, Sun workstations, and a CRAY YMP C90 behemoth but finds notebooks take up less desk space.

He dodges, he weaves, and he never gets enough sleep. He is kind to small animals.

Chris was born and bred in Australia but splits his time between Toronto and Melbourne, depending on the weather. For relaxation he is into road cycling, snowboarding, rock climbing, and storm chasing.

Ken Bertelson
United States United States
No Biography provided

Mario Zucca
Web Developer
Italy Italy
No Biography provided

Fred Ackers
Web Developer
United States United States
Programming using MFC and ATL for almost 12 years now. Currently studying Operating System implementation as well as Image processing. Previously worked on DSP and the use of FFT for audio application. Programmed using ADO, ODBC, ATL, COM, MFC for shell interfacing, databasing tasks, Internet items, and customization programs.

You may also be interested in...

Comments and Discussions

GeneralEnabling file drag 'n' drop from non-elevated processes in elevated app Pin
David Pritchard16-Jul-15 5:02
memberDavid Pritchard16-Jul-15 5:02 
BugInsert a new row or column Pin
freeman86819-Sep-14 23:28
memberfreeman86819-Sep-14 23:28 
GeneralRe: Insert a new row or column Pin
freeman86828-Sep-14 17:47
memberfreeman86828-Sep-14 17:47 
QuestionMy vote of 5! Pin
Manikandan1026-May-14 6:00
professionalManikandan1026-May-14 6:00 
GeneralMy vote of 5 Pin
Marco Bertschi21-Mar-13 0:23
memberMarco Bertschi21-Mar-13 0:23 
GeneralMy vote of 5 Pin
sariqkhan20-Nov-12 16:57
membersariqkhan20-Nov-12 16:57 
BugBug fix for frozen columns Pin
David Pritchard13-Sep-11 4:58
memberDavid Pritchard13-Sep-11 4:58 
AnswerRe: Bug fix for frozen columns Pin
David Pritchard13-Sep-11 4:59
memberDavid Pritchard13-Sep-11 4:59 
QuestionIs any full row selection api? Pin
ERLN10-Aug-11 1:37
memberERLN10-Aug-11 1:37 
GeneralNumbers only Pin
Member 2608808-May-11 7:44
memberMember 2608808-May-11 7:44 
QuestionCan't create MFCGridCtrl in the DLL dialog Pin
s9510301025-May-10 20:54
members9510301025-May-10 20:54 
QuestionCFormView-based application doesn't catch the WM_NOTIFY messages Pin
hjfyyy9-Apr-10 4:33
memberhjfyyy9-Apr-10 4:33 
Questionany version? Pin
fira211124-Feb-08 15:41
memberfira211124-Feb-08 15:41 
GeneralFlikerring in Grid Pin
kansagous25-Dec-07 19:21
memberkansagous25-Dec-07 19:21 
Questionc++ compiler code Pin
Hrishikesh Raverkar2-Apr-07 6:28
memberHrishikesh Raverkar2-Apr-07 6:28 
i need knowledge about c++ compiler code
i also need a project on that with brieaf discription
iam in B.E. computer science
& what r the basics of compiler design?
Confused | :confused: Confused | :confused:

Hrishikesh Raverkar

QuestionScrolling with keyboard after changing window Pin
ensger9-Mar-07 3:38
memberensger9-Mar-07 3:38 
GeneralI need a VB source code about MSFlexGrid Pin
HoangTuCoDon12-Oct-05 16:48
memberHoangTuCoDon12-Oct-05 16:48 
Generali need C++ projecty Pin
Anonymous30-Sep-05 12:09
sussAnonymous30-Sep-05 12:09 
GeneralRe: i need C++ projecty Pin
toxcct10-Jan-06 0:05
membertoxcct10-Jan-06 0:05 
Questioni need project in C++ Pin
Anonymous30-Sep-05 12:07
sussAnonymous30-Sep-05 12:07 
Questioni need C++ project Pin
Anonymous30-Sep-05 12:04
sussAnonymous30-Sep-05 12:04 
GeneralResizing Columns Pin
John Simmons / outlaw programmer9-Feb-05 4:18
memberJohn Simmons / outlaw programmer9-Feb-05 4:18 
QuestionBlinking cells - anyone interested? Pin
John Simmons / outlaw programmer7-Feb-05 3:25
memberJohn Simmons / outlaw programmer7-Feb-05 3:25 
AnswerRe: Blinking cells - anyone interested? Pin
Stober23-Feb-06 4:36
memberStober23-Feb-06 4:36 
GeneralRe: Blinking cells - anyone interested? Pin
John Simmons / outlaw programmer21-Mar-06 10:32
memberJohn Simmons / outlaw programmer21-Mar-06 10:32 
AnswerRe: Blinking cells - anyone interested? Pin
Garth J Lancaster5-Feb-07 0:53
memberGarth J Lancaster5-Feb-07 0:53 
GeneralRe: Blinking cells - anyone interested? Pin
John Simmons / outlaw programmer5-Feb-07 12:52
mvpJohn Simmons / outlaw programmer5-Feb-07 12:52 
GeneralRe: Blinking cells - anyone interested? Pin
Garth J Lancaster5-Feb-07 13:45
memberGarth J Lancaster5-Feb-07 13:45 
GeneralGetting WM_MOUSEMOVE message in parent window Pin
John Simmons / outlaw programmer29-Sep-04 0:30
memberJohn Simmons / outlaw programmer29-Sep-04 0:30 
GeneralRe: Getting WM_MOUSEMOVE message in parent window Pin
John Simmons / outlaw programmer30-Sep-04 11:05
memberJohn Simmons / outlaw programmer30-Sep-04 11:05 
GeneralProblem selecting item from a combo box cell Pin
rsegal2-Jan-04 6:24
memberrsegal2-Jan-04 6:24 
Generalbug fix required Pin
Joey Bloggs20-Oct-03 21:10
memberJoey Bloggs20-Oct-03 21:10 
QuestionWhat is the best way to implement a button in the grid? Pin
blaylockr2-Sep-03 11:10
memberblaylockr2-Sep-03 11:10 
GeneralResource only dll Pin
Dave Barker1-Sep-03 13:59
memberDave Barker1-Sep-03 13:59 
QuestionHow to clear a cell's buttons? Pin
kim-ryo14-Jun-03 7:43
memberkim-ryo14-Jun-03 7:43 
Generalabout code project Pin
kvpadma30-Mar-03 21:09
memberkvpadma30-Mar-03 21:09 
GeneralRe: about code project Pin
Anonymous28-May-03 9:28
sussAnonymous28-May-03 9:28 
Generalabout cpe project Pin
kvpadma30-Mar-03 21:07
memberkvpadma30-Mar-03 21:07 
GeneralA few questions Pin
mx48213-Feb-03 5:36
membermx48213-Feb-03 5:36 
GeneralRe: A few questions Pin
Chris Maunder20-Feb-03 3:05
adminChris Maunder20-Feb-03 3:05 
GeneralRe: A few questions Pin
mx48220-Feb-03 4:17
membermx48220-Feb-03 4:17 
GeneralChanging configs Pin
PhilipReed19-Mar-03 12:17
memberPhilipReed19-Mar-03 12:17 
QuestionBug in load? Pin
rowkajjh226-Nov-02 22:59
memberrowkajjh226-Nov-02 22:59 
GeneralGetMouseScrollLines strange behaviour Pin
Giovanni Verzino8-Oct-02 4:57
memberGiovanni Verzino8-Oct-02 4:57 
Generaldouble precision cell data Pin
PeterM14-Aug-02 15:49
memberPeterM14-Aug-02 15:49 
GeneralAccelerators don't work with TitleTips Pin
Angelika29-Jul-02 2:28
sussAngelika29-Jul-02 2:28 
Questioncan i use this Grid with Visual Basic? Pin
Anonymous7-Jun-02 8:00
memberAnonymous7-Jun-02 8:00 
GeneralNewbe question on recieving messages Pin
Robert Pellegrini28-May-02 4:12
memberRobert Pellegrini28-May-02 4:12 
Generalon-click for all cells Pin
masoud22-May-02 13:42
membermasoud22-May-02 13:42 
Questionm_bPrinting not a member of pDC in WinCE under eVC++ 3.0?? Pin
VanHlebar7-Jan-02 15:04
memberVanHlebar7-Jan-02 15:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.151002.1 | Last Updated 6 Jun 2000
Article Copyright 2000 by Chris Maunder, Ken Bertelson, Mario Zucca, Fred Ackers
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid