Solved

msflexgrid

Posted on 1998-12-18
6
647 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.
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.

920 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

16 Experts available now in Live!

Get 1:1 Help Now