Editable Flex Grid (without an Edit control)

Editable Flex Grid: How to edit Flex grid?

Indeed there is a demo project in MSDN for VB. But there is no
example for VC. There is no one to one conversion of the source from
VB to VC. Even if you convert the VB project to VC, you are still left
with some of the magic numbers to map correctly edit box to the grid
cell. For my different views I have to always twick those magic numbers
to get edit box in sync with the flexgrid cells. At the end of the article
I shown the edit box approach also. If some body knows a way to eliminate
those magic numbers, please let me know.

I used a different approach than using an Edit control. With this approach, I am
trapping the keys and manipulating them which gives user a feeling as
he is editing the grid cell directly.

This approach is very easy to use as I put all the functionality in a single
class called CGrid.

Using the CGrid Class

You simply need to include this class' header file in your project and
declare a CGrid object.

CGrid m_grid;

Define an HWND hGrid variable in your view class.

From the Flex Grid click and key press events just call the
m_grid equivalent functions as follows:

Magic Numbers

Posted by dhn
on 10/22/2005 06:44pm

I think the magic number are because GetWindowRect gets the rectangle for the whole window, not the client area, that is in included the title area, frame etc. MoveWindow is relative to the parents client area.
The best way to work these out these magic numbers is with calls to GetWindowInfo and AdjustWindowRectEx. From these it is possible to work out the offsetsto the client area.

PleaseHelpme..emergency!!

Hi ! I have just gone through your article.
It is really Impressive Article.
Now, What i have problem.
It is that when i put MSFlexgridControl into Propertypage then that page itself is going to be disappeared from the sheet.Please, give me the solution...