Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Using MSFlexGrid in Visual C++

Posted on 1998-12-13
5
Medium Priority
?
589 Views
Last Modified: 2008-02-20
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++.
0
Comment
Question by:hirjointab
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 

Author Comment

by:hirjointab
ID: 1180074
Edited text of question
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1180075
Are you using a data-bound grid?
0
 

Author Comment

by:hirjointab
ID: 1180076
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.
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1180077
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.

J.R.
0
 

Accepted Solution

by:
nir_m_ earned 300 total points
ID: 1180078
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)
example:
COleVariant location;
location= (long)1;
m_grid.Add(
m_grid.AddItem("abc\tdef\tghi", location);

this will add each of the sub-strings - abc | def | ghi into seperate columns.
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question