Click here to Skip to main content
13,199,852 members (68,528 online)
Click here to Skip to main content
Add your own
alternative version


5 bookmarked
Posted 27 Mar 2013

MFC Grid control 2.27 Compatibility with Grid Control 2.21

, 27 Mar 2013
Rate this:
Please Sign up or sign in to vote.
Minor changes on CGridCtrl 2.27 for compatibility with old version of this control


This grid is the work of thousands of hours of squinting at pixels, hunting memory leaks, adding new features, fixing new bugs and beating the code by force of will into a form that is as feature rich and usable as something of this form can be. Dozens of developers from all over the world have contributed fixes, improvements and suggestions over the 4 years that the grid has been growing, and there is still no end in sight. Most of the fixes have been sent in by readers so I'm trusting that they have done sufficient testing. Please click for more information.

Release 2.27 is a minor update of 2.26 for Visual Studio 2010 and includes a couple of minor bug fixes. Version 2.26 is still available for download here, but at this release we lost AddPoint() method and m_strType at the version 2.21 of this control. I solve that problem with minor changes.

 void BOOL CGridCtrl::AddPoint(CStringArray* ColStr,int row,int ColNo,int iImage)
	int col = 0;
	GV_ITEM Item;

	int r = GetRowCount();
	if(row >= r)
	r = GetRowCount();

	for(col = 0 ; col < ColNo ; col++)
		Item.mask = GVIF_TEXT;
		Item.row = row;
		Item.col = col;
		Item.crFgClr = RGB(255,0,0);  

		if(col == 0)
			Item.iImage = iImage;
			Item.mask    |= (GVIF_FGCLR | GVIF_IMAGE);
			Item.mask    |= (GVIF_FGCLR);
			Item.strText = ColStr->GetAt(col);
	return true;


  • Thanks to Chris Maunder


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


About the Author

Aydin Homay
Software Developer (Senior) CM S. A.
Portugal Portugal
I am an eternal programmer.

You may also be interested in...


Comments and Discussions

QuestionWhat is this AddPoint method for? Pin
ehaerim17-Oct-13 10:51
memberehaerim17-Oct-13 10:51 
AnswerRe: What is this AddPoint method for? Pin
professionalAYDIN EBRAHIMI HOMAY17-Oct-13 22:43 
GeneralRe: What is this AddPoint method for? Pin
ehaerim18-Oct-13 0:52
memberehaerim18-Oct-13 0:52 
V2.27 does not support that method any more.
So i doubt I would get any answer for that method.

Why don't you give me an example using AddMethod?

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.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.171020.1 | Last Updated 27 Mar 2013
Article Copyright 2013 by Aydin Homay
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid