I have a grid control on a form in a eVB v3.0 program running on the
PocketPC 2002 emulator. The grid control has the SelectionMode property set
to flexSelectionByRow. I don't want the user to be able to select multiple
rows in the grid [e.g. press MB1 and drag mouse pointer up/down and then
release MB1]. Towards this goall, I inserted the following code in my form:
Private Sub GridCtrl1_SelChange()
If GridCtrl1.Row <> GridCtrl1.RowSel Then
GridCtrl1.RowSel = GridCtrl1.Row
Modifying the RowSel property via code is supposed to fire the SelChange
event and I didn't want an endless set of this event being fired; I put in a
test to see if the current Row is the same as RowSel, and only change RowSel
if it is not the same as Row.
Unfortunately, there are some odd situations in which I can still get
multiple rows to be selected in the grid. For example, if I have 4 rows
[0...3] and 3 columns [0..2], I can down-click on <1,0>, move the pointer to
<3,0> and then release the mouse button. As expected, only row #1 stays
highlighted. However, if I now down-click at <3,0> and move the mouse
pointer to <1,0>, I get rows 1..3 selected; this shouldn't happen. It is
almost as if the SelChange event is not being fired for the grid control
even though the multiple row selection is being displayed in the grid control.
Any ideas on what I'm doing wrong?
ChuckChopp (at) rtfmcsi (dot) com http://www.rtfmcsi.com
ICQ # 22321532
RTFM Consulting Services Inc. 864 801 2795 voice & voicemail
103 Autumn Hill Road 864 801 2774 fax
Greer, SC 29651 800 774 0718 pager
8007740718 (at) skytel (dot) com
Do not send me unsolicited commercial email.