Click here to Skip to main content
15,891,910 members
Articles / Desktop Programming / MFC
Article

The Grid Control

, , ,
Rate me:
Please Sign up or sign in to vote.
4.92/5 (30 votes)
5 Jun 2000CPOL 519.7K   191   123
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

Introduction

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

License

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


Written By
Founder CodeProject
Canada Canada
Chris Maunder is the co-founder of CodeProject and ContentLab.com, and has been a prominent figure in the software development community for nearly 30 years. Hailing from Australia, Chris has a background in Mathematics, Astrophysics, Environmental Engineering and Defence Research. His programming endeavours span everything from FORTRAN on Super Computers, C++/MFC on Windows, through to to high-load .NET web applications and Python AI applications on everything from macOS to a Raspberry Pi. Chris is a full-stack developer who is as comfortable with SQL as he is with CSS.

In the late 1990s, he and his business partner David Cunningham recognized the need for a platform that would facilitate knowledge-sharing among developers, leading to the establishment of CodeProject.com in 1999. Chris's expertise in programming and his passion for fostering a collaborative environment have played a pivotal role in the success of CodeProject.com. Over the years, the website has grown into a vibrant community where programmers worldwide can connect, exchange ideas, and find solutions to coding challenges. Chris is a prolific contributor to the developer community through his articles and tutorials, and his latest passion project, CodeProject.AI.

In addition to his work with CodeProject.com, Chris co-founded ContentLab and DeveloperMedia, two projects focussed on helping companies make their Software Projects a success. Chris's roles included Product Development, Content Creation, Client Satisfaction and Systems Automation.

Written By
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.

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

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

Comments and Discussions

 
QuestionSub-Cells? Pin
Rich Goldstein15-Nov-00 3:05
Rich Goldstein15-Nov-00 3:05 
QuestionHow to join two cells Pin
14-Nov-00 7:46
suss14-Nov-00 7:46 
AnswerRe: How to join two cells Pin
Holger Persch15-Nov-00 19:30
Holger Persch15-Nov-00 19:30 
GeneralRe: How to join two cells Pin
12-Jul-01 23:32
suss12-Jul-01 23:32 
GeneralMultiline in a cell Pin
8-Nov-00 20:41
suss8-Nov-00 20:41 
GeneralRe: Multiline in a cell Pin
Chris Maunder9-Nov-00 5:48
cofounderChris Maunder9-Nov-00 5:48 
GeneralRe: Multiline in a cell Pin
Marco Giuntoni24-Nov-00 7:37
professionalMarco Giuntoni24-Nov-00 7:37 
GeneralFreeze or Split Pin
Carsten Koscher26-Oct-00 7:28
sussCarsten Koscher26-Oct-00 7:28 
GeneralCGridCellAVI Pin
Jeremy Davis17-Oct-00 3:04
Jeremy Davis17-Oct-00 3:04 
GeneralRe: CGridCellAVI Pin
Chris Maunder17-Oct-00 3:27
cofounderChris Maunder17-Oct-00 3:27 
GeneralComment support Pin
Doug Benson28-Sep-00 7:36
Doug Benson28-Sep-00 7:36 
QuestionHow to Resize Columns in MSFlexGrid Pin
manish26-Sep-00 21:52
manish26-Sep-00 21:52 
GeneralVirtual Mode & Callback function Pin
Crercio O. Silva22-Sep-00 7:11
Crercio O. Silva22-Sep-00 7:11 
GeneralRe: Virtual Mode & Callback function Pin
Andrea Balducci2-Oct-00 23:13
Andrea Balducci2-Oct-00 23:13 
GeneralNeed Clue Constructing Grid?!? :-) Pin
Darrell Reich24-Jul-00 9:01
Darrell Reich24-Jul-00 9:01 
GeneralRe: Need Clue Constructing Grid?!? :-) Pin
Steven Mitcham28-Jul-00 7:50
Steven Mitcham28-Jul-00 7:50 
GeneralSetting column width by character count Pin
wee_malky24-Jul-00 3:02
wee_malky24-Jul-00 3:02 
GeneralMFC Grid Control versions Pin
Jose Luis Balsera14-Jun-00 0:48
Jose Luis Balsera14-Jun-00 0:48 
GeneralVirtual List Pin
Member 75815-May-00 16:38
Member 75815-May-00 16:38 
GeneralRe: Virtual List Pin
Chris Maunder15-May-00 23:44
cofounderChris Maunder15-May-00 23:44 
GeneralRe: Virtual List Pin
POINDRON Frederic17-May-00 6:50
sussPOINDRON Frederic17-May-00 6:50 
QuestionActiveX from C++ ? Pin
Member 116315-May-00 8:30
Member 116315-May-00 8:30 
AnswerRe: ActiveX from C++ ? Pin
Chris Maunder15-May-00 23:46
cofounderChris Maunder15-May-00 23:46 

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

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