Solved

msflexgrid

Posted on 1998-12-18
6
645 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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

707 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now