There are a number of things to be aware of when creating such CWnd derived Edit classes: In Edit I create a CWnd derived class that will perform the actual editing - in this case my CInPlaceList from previous versions of the grid. You can find this class in the GridCellCombo.* files. 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.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |