Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Report Control
  New Posts New Posts RSS Feed - Column sizing
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Column sizing

 Post Reply Post Reply
Author
Message
schwinn View Drop Down
Groupie
Groupie
Avatar

Joined: 17 April 2009
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote schwinn Quote  Post ReplyReply Direct Link To This Post Topic: Column sizing
    Posted: 09 June 2010 at 10:35am
Hi
 
Really struggling here and dont know what I'm doing wrong. My report column is not setting the correct size. Let me explain...
 
We have 2 related views in an application. We make changes in one view and it affects the other view, the results view. The results view is my report control, consisting of 39 columns of selectable results. By default we only have 6 selected. We dont want last column expanded, we want each column to be best fit or if the user has manually resized the column then that column stays that width.
 
The results view has on activate code that;
1. ResetContent
2. Put the rows of data into all the columns.
3. Populate.
4. I then iterate each column each column and do GetReportHeader()->BestFit(pCol), unless the column has been manually sized.
 
 
My Problem.
1. Make changes in the first view, lets say make a text string long.
2. Switch to the results view.
3. Select the column to make visible (the column that has a long text string)
4. Problem...the column is now wide enough for the data, it shows ... on the string.
5. I switch back to the other view and switch back again to the results view and the column is now wide enough, the ... has gone.
 
 
Can anyone tell me why this happening, why im getting the .... I want it to be the correct width to start with
 
Thanks for any help
 
Back to Top
schwinn View Drop Down
Groupie
Groupie
Avatar

Joined: 17 April 2009
Status: Offline
Points: 12
Post Options Post Options   Thanks (0) Thanks(0)   Quote schwinn Quote  Post ReplyReply Direct Link To This Post Posted: 11 June 2010 at 8:24am
Solved the problem by forcing a repaint
 
m_wndReport.SendMessage(WM_PAINT, 0, 0);
 
Believe the problem to be something to do with m_nMaxItemWidth
Back to Top
Michl View Drop Down
Senior Member
Senior Member


Joined: 14 September 2007
Status: Offline
Points: 138
Post Options Post Options   Thanks (0) Thanks(0)   Quote Michl Quote  Post ReplyReply Direct Link To This Post Posted: 29 July 2010 at 7:45am
I think it is more nice to call
m_wndReport.RedrawControl();
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.203 seconds.