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
Solved

msflexgrid

Posted on 1998-12-18
6
652 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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

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 …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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++.

860 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