The first step is to derive a new class from CGridCell - I call it CGridCellCombo - and override Edit (which initiates editing) and EndEdit (which stops editing). It's not the greatest - but it does demonstrate how to replace the default editing. I'm using the In-Place list that I used in previous versions. A new cell typeĬhanging the way cells are edited is simply a matter of deriving a new grid cell class from CGridCellBase (or derivatives such as CGridCell). With the new structure in the 2.X versions of CGridCtrl it's now a lot simpler. Previous methods of achieving this required that a new CGridCtrl derived class be created. For some this was a little too involved, so I've created a demo project that shows how to replace the default editing with a simple combo box. Ken Bertelson has taken this to the extreme, with his Grid Tree control. Since I posted my MFC grid control I've had a lot of requests asking how to use other methods of editing cells in the grid. Download full grid demo (v2.20) - 201.5 KB.Download full grid demo (v2.20, no executable) - 148.6 KB.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |