Print Page | Close Window

ListView report view autosize columns

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Suite Pro
Forum Description: Topics Related to Codejock Suite Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=19375
Printed Date: 29 September 2024 at 12:21am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: ListView report view autosize columns
Posted By: TomasS
Subject: ListView report view autosize columns
Date Posted: 03 January 2012 at 6:58am
I'm in the process of replacing VB listviews with the CJ version. I now have problems getting the columns to autosize. There is no autosize property in either the VB, or CJ listview but in VB I have used the method to send LV_SETCOLUMNWIDTH messages to the control with column index as lparam and -2 as wparam. This has worked great with the VB listview both for the columnheaders and item, subitem text. In the CJ version it does not work for the column headers only for the data text. This is no good since the column header text gets ellipsed and any sortorder arrow gets hidden...
Does anyone know any workaround or fix for this? 
Could CJ add Autosize to the ListView?

Now speculating: Since I suspect the CJ ListView is based on the native ListView but column headers are manually drawn on top of it, that may be the root cause for the behavior. The messages I send arrange the columns fine, but the native control behind the scenes has no text in its column headers. Therefore the headers are not considered in the autosizing.


-------------
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit
Visual Basic 6.0



Replies:
Posted By: TomasS
Date Posted: 03 January 2012 at 7:33am
One change: The sort order arrow is not hidden. It however hides even more of the column header text due to the problem described in one other popular post:
http://forum.codejock.com/forum_posts.asp?TID=18454&title=listview-column-sort-order-arrows-missing - http://forum.codejock.com/forum_posts.asp?TID=18454&title=listview-column-sort-order-arrows-missing


-------------
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit
Visual Basic 6.0


Posted By: TomasS
Date Posted: 03 January 2012 at 9:53am
Well, I got the LV_SetColumnWidth -2 trick actually works fine if you have SendMessage properly declared with wParam as Long in VB6... I had a declaration with As Any for some purpose... Now it does consider the column header text.
However the problem with the sort order arrow remains. After setting the column width the sort order arrow will make the header ellipsed. Not nice. I would appreciate a solution to the original problem with the sort order arrow as described in my last reply to the 18454 post. (see link above)


-------------
Xtreme SuitePro (ActiveX) version 17.3.0, 16.3.1
Windows 10 64-bit
Visual Basic 6.0



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net