Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Using MSFlexGrid in MFC application

Posted on 2003-11-06
7
Medium Priority
?
990 Views
Last Modified: 2013-11-20
Hi All,
I'm using a MSFlexGrid control in my MFC application on a resizable dialog
which is placed on a view.
I want to know how to resize the grid when the parent dialog is resized.
like when my application is maximized the dialog gets resized but the flexgrid
column size remains the same and hence the user is able to see lot of empty
space.
i want to resize the column width for each cell and the width of the grid itself.
Can anyone help me out

Thanks in advance
Raghav
0
Comment
Question by:raghavphil
[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
  • 4
  • 3
7 Comments
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9693403
What about "ColWidth()" function?
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9693413
Ooops its "SetColWidth()"

eg:
     m_oFlexGrid.SetColWidth(0, 1600);
     m_oFlexGrid.SetColWidth(1, 2400);
     m_oFlexGrid.SetTextMatrix(0, 0, "ONE");
     m_oFlexGrid.SetTextMatrix(0, 1, "TWO");

Good Luck
0
 

Author Comment

by:raghavphil
ID: 9693933
This has to be done dynamically right...
when the main app is resized , the view window which has the grid is also resized.
I have two columns in my grid. First has a fixed width.
I want the second to be expanded when the view is resized. Is it possible to do with this!!
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!

 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9693993
Yes, Map WM_SIZE for resizing of GRID

void CYourView::OnSize(int cx, int cy)
{
     m_oFlexGrid..MoveWindow(0,0,cx,cy);
   
     // Also increase the column width as mentioned above
}

0
 

Author Comment

by:raghavphil
ID: 9698846
Yes...i understand this part.
But i have a splitter window used for my view and it contains two views. one is a tree view and the other is a Dialog put in a view.This dialog contains a Grid.
So how do i calculate the new size of this dialog. This is where it's causing problems. Any solutions??

0
 
LVL 23

Accepted Solution

by:
Roshan Davis earned 450 total points
ID: 9698883
Yes, Map WM_SIZE for resizing of Dialog
void CYourView::OnSize(int cx, int cy)
{
    m_odlg..MoveWindow(0,0,cx,cy);
   
    // Also increase the column width as mentioned above
}

And Map WM_SIZE of Dialog for resizing of GRID

void CDialogEx::OnSize(int cx, int cy)
{
    m_oFlexGrid..MoveWindow(0,0,cx,cy);
   
    // Also increase the column width as mentioned above
}


Rosh
0
 

Author Comment

by:raghavphil
ID: 9712377
Hi Roshmon,
Thanks for the answer.... it works...
you seem to be lot experienced in FlexGrid....
i might need some more help in future... ofcoz u'll get points :-)

Once again thanks for the answer

regards
Raghav
0

Featured Post

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
In this post we will learn different types of Android Layout and some basics of an Android App.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Suggested Courses

670 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