Click here to Skip to main content
15,608,157 members
Articles / Desktop Programming / MFC
Article
Posted 12 May 2000

Stats

500K views
191 bookmarked

The Grid Control

, , ,
Rate me:
Please Sign up or sign in to vote.
4.92/5 (30 votes)
5 Jun 2000CPOL
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
Current passion project: CodeProject.AI Server. Please join in!

Chris is the Co-founder of the popular code-sharing site CodeProject.com, the digital advertising agency DeveloperMedia.com and the content marketing agency ContentLab.IO.

He's been programming way too long and has been, in various guides, an astrophysicist, mechanic, mathematician, physicist, breeder of carnivorous plants, hydrologist, geomorphologist, defence intelligence researcher and then, when all that got a bit rough on the nerves, a serial entrepreneur.

Chris has programmed everything from FORTRAN on a CRAY to Python on a Pi, but generally leans on TypeScript, C#, and SQL for the front, middle and back bits of his applications. His current focus is on ensuring developers know enough about Artificial Intelligence to be dangerous.

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

 
GeneralEnabling file drag 'n' drop from non-elevated processes in elevated app Pin
David Pritchard16-Jul-15 5:02
David Pritchard16-Jul-15 5:02 
BugInsert a new row or column Pin
freeman86819-Sep-14 23:28
freeman86819-Sep-14 23:28 
GeneralRe: Insert a new row or column Pin
freeman86828-Sep-14 17:47
freeman86828-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
professionalMarco Bertschi21-Mar-13 0:23 
GeneralMy vote of 5 Pin
sariqkhan20-Nov-12 16:57
sariqkhan20-Nov-12 16:57 
excellent
BugBug fix for frozen columns Pin
David Pritchard13-Sep-11 4:58
David Pritchard13-Sep-11 4:58 
AnswerRe: Bug fix for frozen columns Pin
David Pritchard13-Sep-11 4:59
David Pritchard13-Sep-11 4:59 
QuestionIs any full row selection api? Pin
ERLN10-Aug-11 1:37
ERLN10-Aug-11 1:37 
GeneralNumbers only Pin
Member 2608808-May-11 7:44
Member 2608808-May-11 7:44 
QuestionCan't create MFCGridCtrl in the DLL dialog Pin
s9510301025-May-10 20:54
s9510301025-May-10 20:54 
QuestionCFormView-based application doesn't catch the WM_NOTIFY messages Pin
hjfyyy9-Apr-10 4:33
hjfyyy9-Apr-10 4:33 
Questionany vb.net version? Pin
fira211124-Feb-08 15:41
fira211124-Feb-08 15:41 
GeneralFlikerring in Grid Pin
kansagous25-Dec-07 19:21
kansagous25-Dec-07 19:21 
Questionc++ compiler code Pin
Hrishikesh Raverkar2-Apr-07 6:28
Hrishikesh Raverkar2-Apr-07 6:28 
QuestionScrolling with keyboard after changing window Pin
ensger9-Mar-07 3:38
ensger9-Mar-07 3:38 
GeneralI need a VB source code about MSFlexGrid Pin
nhbach220312-Oct-05 16:48
nhbach220312-Oct-05 16:48 
Generali need C++ projecty Pin
Anonymous30-Sep-05 12:09
Anonymous30-Sep-05 12:09 
GeneralRe: i need C++ projecty Pin
toxcct10-Jan-06 0:05
toxcct10-Jan-06 0:05 
Questioni need project in C++ Pin
Anonymous30-Sep-05 12:07
Anonymous30-Sep-05 12:07 
Questioni need C++ project Pin
Anonymous30-Sep-05 12:04
Anonymous30-Sep-05 12:04 
GeneralResizing Columns Pin
#realJSOP9-Feb-05 4:18
mva#realJSOP9-Feb-05 4:18 
QuestionBlinking cells - anyone interested? Pin
#realJSOP7-Feb-05 3:25
mva#realJSOP7-Feb-05 3:25 
AnswerRe: Blinking cells - anyone interested? Pin
Stober23-Feb-06 4:36
Stober23-Feb-06 4:36 
GeneralRe: Blinking cells - anyone interested? Pin
#realJSOP21-Mar-06 10:32
mva#realJSOP21-Mar-06 10:32 

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.