Microsoft KB Archive/263667

= BUG: Scroll Event of CE Grid Control Fires When You Change SelectionMode Property =

Article ID: 263667

Article Last Modified on 9/4/2002

-

APPLIES TO


 * Microsoft eMbedded Visual Basic 3.0

-



This article was previously published under Q263667



SYMPTOMS
When you change the SelectionMode property of a CE Grid control, if the cell that has focus is not visible, the Scroll event fires until the cell that had focus prior to the SelectionMode change is visible in the Grid.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce Behavior
 Create a new PocketPC project in eMbedded Visual Basic (eVB). Form1 is created by default. Add a CE Grid control and three Option buttons to Form1.  Paste the following code into Form1: Option Explicit

Private Sub Form_Activate Dim x  GridCtrl1.Rows = 10 GridCtrl1.Cols = 3 For x = 0 To 9 GridCtrl1.AddItem x, x  Next x End Sub

Private Sub Form_Load Form1.Height = 4065 Form1.Width = 5040 GridCtrl1.Height = 2175 GridCtrl1.Left = 1920 GridCtrl1.Top = 1200 GridCtrl1.Width = 2775 Option1.Top = 120 Option2.Top = 480 Option3.Top = 840 Option1.Left = 120 Option2.Left = 120 Option3.Left = 120 Option1.Width = 2295 Option2.Width = 2295 Option3.Width = 2295 Option1.Caption = &quot;flexSelectionFree&quot; Option2.Caption = &quot;flexSelectionByRow&quot; Option3.Caption = &quot;flexSelectionByColumn&quot; End Sub

Private Sub Form_OKClick App.End End Sub

Private Sub GridCtrl1_Scroll MsgBox &quot;Scroll&quot; End Sub

Private Sub Option1_Click GridCtrl1.SelectionMode = flexSelectionFree End Sub

Private Sub Option2_Click GridCtrl1.SelectionMode = flexSelectionByRow End Sub

Private Sub Option3_Click GridCtrl1.SelectionMode = flexSelectionByColumn End Sub  Run the application. Select a cell, and then scroll until the selected cell is no longer in view. Click flexSelectionFree. The GridCtrl1_Scroll event fires and displays the Scroll message box until the previously selected cell is visible. Scroll until the selected cell is out of view again, and click flexSelectionByRow. The GridCtrl1_Scroll event fires and displays the Scroll message box until the previously selected cell is visible. Scroll until the selected cell is out of view one more time, and click flexSelectionByColumn. The GridCtrl1_Scroll event fires and displays the Scroll message box until the top of the column is visible. When the column is selected, the active cell is always the top cell.</li></ol>

When the selected cell is not in the viewable area of the Grid, and the SelectionMode property of the Grid is changed, the scroll event of the Grid fires until the cell appears in the viewable area.

Keywords: kbbug kbpending KB263667

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.