?
Solved

msflexgrid

Posted on 1998-12-18
6
Medium Priority
?
665 Views
Last Modified: 2008-03-04
How do I control a msflexgrid in VC++??
the msflexgrid will be inside a dialog box!
i've tried the same thing in VB and it works...but not in VC++!
pls help..
0
Comment
Question by:at75
[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
  • 3
  • 2
6 Comments
 
LVL 11

Accepted Solution

by:
mikeblas earned 50 total points
ID: 1180452
msflexgrid works fine in VC++.  It's something you're doing wrong, yourself.

B ekiM
0
 

Author Comment

by:at75
ID: 1180453
Mike:  Thanks for taking time to answer .My question is not clear. Let me re phrase the question again.I'm using Msflexigrid v5 in a dialog box.Somehow i was not able to control the currently selected cell.As a new user in VC++ , there are many commands that i'm not familiar.
that's say i'm going to control the number of rows,  i  use something like :
      
dlg.m_msflexgrid1.SetRows(3);

but that doesn't work!

did i miss out anything? or wrong way of writing the code?
Pls show me the correct way to code .

Thanks alot!    
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1180454
SetRows() sets the number of total rows in the control.

You want to use SetRow() and SetCol() methods to set the row and column of the currently selected cell. If you want to do multiple-selection, you'll also need to ColSel() and RowSel() methods.

(All this information is in the online help for the control.)

B ekiM


0
Industry Leaders: 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!

 

Author Comment

by:at75
ID: 1180455
void CFYP1View::OnViewDhparameter()
{
// TODO: Add your command handler code here

CViewDlg dlg;
dlg.m_msflexgrid1.SetCol(2);

i tried adding "dlg.m_msflexgrid1.SetCol(2) " in the program,however error occurs!
the error is: debug assertion failed!
                  file: winocc.cpp
                  line : 349

i just want to control the number of col  but don't seem ot get it!
Pls Help!
thank you!
0
 
LVL 11

Expert Comment

by:mikeblas
ID: 1180456
You're trying to manipulate the control before it's actually been created.  You've created an instance of the C++ object that represents your dialog box, but you haven't created the actual window yet. And since you haven't created the actual dialog box window, you haven't created it's child controls--including the flex grid control.

You can't set the properties of the control until it has actually been created.

B ekiM

0
 

Expert Comment

by:vineshkr
ID: 1180457
What you can do, is add a line in your OnInitDialog() function of the dialog after
          CDialog::OnInitDialog();
          m_FlexGrid.SetCols(5); //object.SetCols(long)

This will work fine.

But I'm having another problem, when I'm manipulating the msflexgrid by some text data, it's not showing the rows after 12th row. I'm still working on the same but I'll appreciate any suggestion for that.

0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

When writing generic code, using template meta-programming techniques, it is sometimes useful to know if a type is convertible to another type. A good example of when this might be is if you are writing diagnostic instrumentation for code to generat…
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…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
Suggested Courses

777 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