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

x
?
Solved

MS FLEXGRID ADDITEM METHOD

Posted on 1998-08-12
3
Medium Priority
?
1,276 Views
Last Modified: 2008-02-01
I AM HAVING PROBLEMS PASSING THE SECOND PARAMETER (INDEX) TO THE FLEXGRID ADDITEM METHOD.
IN VB5 IT IS AN OPTIONAL PARAMETER. HOW SHOULD I PASS IT IN VC++? WHERE CAN I FIND DOCUMENTION ABOUT USING THIS ACTIVE X CONTROL WITH MS VISUAL C++?
0
Comment
Question by:AGUILAR
[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
  • 2
3 Comments
 
LVL 23

Expert Comment

by:chensu
ID: 1170155
When you open the Components and Controls Gallery and select Microsoft FlexGrid Control, press the More Info button to open the help file.
0
 
LVL 2

Accepted Solution

by:
jrmcg earned 50 total points
ID: 1170156
All of the documentation for the MSFlexGrid that I have been able to find has been for Visual Basic.  AddItem inserts a row at a given index (you supply).  If you want to add a row to the end of the grid, make the call like this -

m_Grid.AddItem("Column0Text\tColumn1Text\tColumn2Text",m_GridControl.GetRows());

Tabs inside the string separate the text by column.

m_GridControl is a control variable of type CMSFlexGrid,
usually I just use the wizard to create this.
0
 
LVL 2

Expert Comment

by:jrmcg
ID: 1170157
Correction to the proposed answer:

The parameter is supposed to be of type const struct tagVARIANT &
You can look this structure up in the help files.
Proper usage would be this

// Declare a variable of type tagVARIANT
tagVARIANT RowIndexToAdd;

RowIndexToAdd.vt = VT_I4;       // variable is a 4-byte integer type
RowIndex.lVal = m_Grid.GetRows();     // Gets next row, will increase # of rows
                                                         // You can insert whichever row you want to add

// Now make call to AddItem passing the tagVARIANT
m_Grid.AddItem(csFormattedString, RowIndexToAdd);
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Container Orchestration platforms empower organizations to scale their apps at an exceptional rate. This is the reason numerous innovation-driven companies are moving apps to an appropriated datacenter wide platform that empowers them to scale at a …
Article by: evilrix
Looking for a way to avoid searching through large data sets for data that doesn't exist? A Bloom Filter might be what you need. This data structure is a probabilistic filter that allows you to avoid unnecessary searches when you know the data defin…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.
Suggested Courses

618 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