Results 1 to 40 of 1667

Thread: VBFlexGrid Control (Replacement of the MSFlexGrid control)

Hybrid View

  1. #1
    PowerPoster
    Join Date
    Jun 2013
    Posts
    7,454

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    @Krool (regarding AutoSize)

    It might be worth mentioning, that samer22 is probably using your Grid in bound mode
    (via IVBFlexDataSource).

    On my system, when I use such a Binding - and then call AutoSize in this way (for Col-Autosizing, after setting the Binding):

    FG.AutoSize 0, FG.Cols - 1, FlexAutoSizeModeColWidth, FlexAutoSizeScopeAll

    It seems to use the right "internal Measurement-Texts" only for the Header-Row
    (probably because it did buffer these texts internally already, after retrieving them via IVBFlexDataSource_GetFieldName).

    The "CellTexts below the Header" (corresponding with IVBFlexDataSource_GetData) -
    are apparently not requested when it comes to further Text-measurings "down the lines".

    On another note (not really related to the IVBFlexDataSource-problems above)...
    Is it intentional, that an AutoSize-Call like:

    FG.AutoSize 0 'which leaves the second optional Param at -1

    currently does have the same effect as: FG.AutoSize 0, 0

    I'm aware that this is probably meant to work this way (to affect only a single column).
    What "threw me off" is the "-1" in the optional second param, which usually means "all of them".

    so, the behaviour I expected, leaving the second param out, was: FG.AutoSize 0, FG.Cols - 1

    Olaf

  2. #2

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,742

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    @Krool (regarding AutoSize)

    It might be worth mentioning, that samer22 is probably using your Grid in bound mode
    (via IVBFlexDataSource).

    On my system, when I use such a Binding - and then call AutoSize in this way (for Col-Autosizing, after setting the Binding):

    FG.AutoSize 0, FG.Cols - 1, FlexAutoSizeModeColWidth, FlexAutoSizeScopeAll

    It seems to use the right "internal Measurement-Texts" only for the Header-Row
    (probably because it did buffer these texts internally already, after retrieving them via IVBFlexDataSource_GetFieldName).

    The "CellTexts below the Header" (corresponding with IVBFlexDataSource_GetData) -
    are apparently not requested when it comes to further Text-measurings "down the lines".

    On another note (not really related to the IVBFlexDataSource-problems above)...
    Is it intentional, that an AutoSize-Call like:

    FG.AutoSize 0 'which leaves the second optional Param at -1

    currently does have the same effect as: FG.AutoSize 0, 0

    I'm aware that this is probably meant to work this way (to affect only a single column).
    What "threw me off" is the "-1" in the optional second param, which usually means "all of them".

    so, the behaviour I expected, leaving the second param out, was: FG.AutoSize 0, FG.Cols - 1
    Thanks for your comments.

    It is indeed a bug. The AutoSize should fetch the data via IVBFlexDataSource_GetData, if applicable.
    I will fix it soon.

    Concerning the second optional param.
    Well, it is meant to affect only a single row or column if the second parameter is omitted.
    Maybe it would be "nicer" to have the second parameter as a Variant and to check with IsMissing().
    That way the -1 in the intellisense would not "mislead" somebody.
    However, I will keep it unchanged to not break compatibility.

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Jun 2012
    Posts
    2,742

    Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)

    Quote Originally Posted by Schmidt View Post
    What "threw me off" is the "-1" in the optional second param, which usually means "all of them".

    so, the behaviour I expected, leaving the second param out, was: FG.AutoSize 0, FG.Cols - 1
    Obviously the vsFlexGrid handles it the same way.

    Col2 is optional. If it is omitted, only Col1 is resized.
    Code:
    [form!]VSFlexGrid.AutoSize Col1 As Long, [ Col2 As Long ], [ Equal As Boolean ], [ ExtraSpace As Single ]
    http://helpcentral.componentone.com/...sizemethod.htm

    So, it's all good as it is..

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width