BUG: Scroll Event of CE Grid Control Fires When You Change SelectionMode Property (263667)



The information in this article 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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. Create a new PocketPC project in eMbedded Visual Basic (eVB). Form1 is created by default.
  2. Add a CE Grid control and three Option buttons to Form1.
  3. 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 = "flexSelectionFree"
        Option2.Caption = "flexSelectionByRow"
        Option3.Caption = "flexSelectionByColumn"
    End Sub
    
    Private Sub Form_OKClick()
        App.End
    End Sub
    
    Private Sub GridCtrl1_Scroll()
        MsgBox "Scroll"
    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
    					
  4. 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.
  5. 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.
  6. 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.
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.

Modification Type:MajorLast Reviewed:9/4/2002
Keywords:kbbug kbDSupport KB263667