Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Report Control
  New Posts New Posts RSS Feed - Column autosize
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Column autosize

 Post Reply Post Reply
Author
Message
@lin View Drop Down
Groupie
Groupie


Joined: 20 September 2006
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote @lin Quote  Post ReplyReply Direct Link To This Post Topic: Column autosize
    Posted: 12 January 2007 at 6:15am
Hello

I want to have a column with autosize, but not in the way autosize works for this control. What I need is that the size of the column to be calculated so that every item to be visible. It is the same like doubleclicking the edge of the header. Can this be done via some funcions implemented in the control or do i have to calculate the size myself?

Thank you
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 14 January 2007 at 10:38am
Hi,

There is a method Column.BestFit which adjusts a column size like you wish. 

Method which will adjust all columns size:

Private Sub AdjustAllColumns()
    Dim i As Integer
    For i = 0 To wndReportControl.Columns.Count - 1
        wndReportControl.Columns(i).BestFit
    Next i
End Sub


Call it from Form_Resize and disable regular column autosizing in Form_Load (.AutoColumnSizing = False)

--
WBR,
Serge
Back to Top
@lin View Drop Down
Groupie
Groupie


Joined: 20 September 2006
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote @lin Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 3:42am
Thanx for your answer. Unfortunatelly it does not work. I have Xtreme Suite ActiveX Controls v10.3 and the method is unavailable for this version.
Back to Top
@lin View Drop Down
Groupie
Groupie


Joined: 20 September 2006
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote @lin Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 3:44am
Also I want this only at first (when filling the grid) and not on resize. Like i said, i want something similar to dblclick on column edge but calable from the code.
Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 17 January 2007 at 3:54pm
Hi,

What is not working? AFAIK method .BestFit was available since the very early versions of the control.

--
WBR,
Serge
Back to Top
@lin View Drop Down
Groupie
Groupie


Joined: 20 September 2006
Status: Offline
Points: 19
Post Options Post Options   Thanks (0) Thanks(0)   Quote @lin Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2007 at 3:43am
For example this line:
wndReportControl.Columns(i).BestFit

Method BestFit is not recognized. It is not available in help also.

Back to Top
sserge View Drop Down
Moderator Group
Moderator Group


Joined: 01 December 2004
Status: Offline
Points: 1297
Post Options Post Options   Thanks (0) Thanks(0)   Quote sserge Quote  Post ReplyReply Direct Link To This Post Posted: 18 January 2007 at 4:35pm
Oops, sorry, BestFit() was added in version 10.4 only. I've mixed it up with MFC version, where it was available from the very beginning...

--
WBR,
Serge
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.141 seconds.