Quote Originally Posted by Krool View Post
The problem is in the vsFlexGrid is that when you change the SelectionMode to ListBox (=MultiSelection) the vsFlexGrid don't initialize the current selection as selected rows.
Whereas the VBFlexGrid initializes the current selection as selected rows when you set AllowMultiSelection to True.

It's a dilemma because SelectionMode is by design not changing anything to not have side-effects which the VBFlexGrid has same behavior.
But since in the VBFlexGrid it's an extra property I can be free.
And it would feel like a bug to not initialize the selected rows..

EDIT: If turning off ListBox selection mode in vsFlexGrid will instantly reset SelectedRows to 0. But when turning on it doesn't set. For me that is not consistent.
Yes, you're right. It does seem like a logical bug. However, I think it also gives users an option. I can either have it initialize with no rows selected, or use a single line of code vsflexgrid.Select 1, 1 to select the first row by default.

In VBFlexGrid, I could use RowSelected(1) = False to deselect the initially selected row. But if VBFlexGrid receives focus via a mouse click, it will automatically select the first row again, and this won't trigger the SelChange event.

vsFlexGrid is the exact opposite: receiving focus doesn't automatically select anything. Selecting the first row does trigger the AfterSelChange event.

Since sometimes I need to use it as a ListBox, I checked the standard ListBox control. Its logic is consistent with vsFlexGrid: receiving focus doesn't automatically select anything (ListIndex = -1), and clicking the first row triggers the Click event.

Admittedly, my specific need might be relatively niche. Or can the SelectionMode support a ListBox mode like in vsFlexGrid?

I think VBFlexGrid is already excellent, even more user-friendly than vsFlexGrid. It would be perfect if it could add a LoadArray method.