Solved

msflexgrid

Posted on 1998-12-18
6
649 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
  • 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
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

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…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 learn how to clear a vector as well as how to detect empty vectors in C++.

805 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