Using MSFlexGrid in Visual C++

How do I get Data into the MSFlexGrid and how do I edit the data (typing)? I have not managed to translate the Tips and Tricks article by Frank Sommer in Visual Basic into C++.
Who is Participating?
nir_m_Connect With a Mentor Commented:
As stated by someone before me, MSFlexGrid does not accept direct keyboard input into it's cells, if you however want to programmaticaly enter values into the cells, just use the function AddItem(<some string here>, location) where location means where to add the item, and the string is tab separated to the columns of the table. (Be aware that the location field is of COleVariant type, which means that if you want to use it from C++ you'll need to pass to it the appropriate type)
COleVariant location;
location= (long)1;
m_grid.AddItem("abc\tdef\tghi", location);

this will add each of the sub-strings - abc | def | ghi into seperate columns.
hirjointabAuthor Commented:
Edited text of question
Are you using a data-bound grid?
hirjointabAuthor Commented:
I'm not sure what "data-bound" means, but I want to use the numbers beeing put into the grid via either the keyboard or cut and past, for further processing in my program.
The MSFlexGrid does not accept direct keyboard input into its cells.
The data-bound grid is similar to the MSFlexGrid, but will accept keyboard input.  It has more of a look like an Excel spreadsheet.  If you take a look at DBGrid in the help files you should find something that will go into detail.
If you want to use the MSFlexGrid, then the MS recommended way to enter data is to open an "input" box when a cell on the grid is selected.  Obviously this is not very user friendly, and is time consuming.  I think you would be better off with the DBGrid.

If you have any questions let me know.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.