-
Feb 27th, 2021, 05:37 AM
#11
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
Originally Posted by Schmidt
@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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|