|
-
Jun 5th, 2025, 12:35 AM
#10
Junior Member
Re: VBFlexGrid Control (Replacement of the MSFlexGrid control)
 Originally Posted by Krool
Update released.
When AllowMultiSelection is True and AllowSelection is False the AllowBigSelection property now controls the behavior whether multiple single selections can be done via shift+ctrl or ctrl.
When AllowBigSelection is set to False (defaults True) it is not allowed anymore and truly single selection.
That is that .SelectedRows can then return only 1 or 0.
@bincong, be aware that altering via .RowSelected(x) does not raise a MultiSelChange event.
This is fantastic, thank you!
After thorough testing, I have several follow-up observations:
1. Why does mouse-click selection trigger the MultiSelChange event twice?
Occurs once on mouse press and once on release. Note: When AllowSelection = True, it triggers only once.
2. Is it expected behavior that re-clicking an already selected row triggers MultiSelChange?
When AllowSelection = True, this does not re-trigger the event.
3. Could a BeforeMultiSelChange event be implemented?
Rationale: Setting Cancel = True in BeforeSelChange doesn't affect MultiSelChange. Additionally, Ctrl-click deselection triggers MultiSelChange but not SelChange.
Separately, I've observed anomalous behavior in BeforeSelChange:
When setting Cancel = True to block selection changes, the selection still changed.
Code:
'Test BeforeSelChange
Private Sub Form_Load()
With VBFlexGrid1
.Rows = 10
.Cols = 5
.SelectionMode = FlexSelectionModeByRow
.AllowSelection = False
.AllowMultiSelection = False
End With
End Sub
Private Sub VBFlexGrid1_BeforeSelChange(ByVal NewRowSel As Long, ByVal NewColSel As Long, Cancel As Boolean)
If NewRowSel > 5 Then Cancel = True
End Sub
Clicking the last row unexpectedly selects all rows simultaneously.
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
|