Grid Control Intermittently does not Show 
Author Message
 Grid Control Intermittently does not Show

Hello

In our eVB App we are using the Grid control extensively with great results.
In one section of our App occaisionally it does not show up even though it's
exactly the same code that works okay normally.  Could there be a glitch or
bug?  If you restart the App and repeat the operation it works fine.

Thanks

David M

  On Error GoTo 0

    grdDistribution.Clear
    grdDistribution.Rows = 0
    txtDistributionHistory.Text = ""

    ' Add grid header.
    grdDistribution.AddItem vbNullString & vbTab & "Entry" & vbTab & "Exit"
& vbTab & vbNullString
    grdDistribution.ColWidth(0) = grdDistribution.Width * 0.6
    grdDistribution.ColWidth(1) = grdDistribution.Width * 0.15
    grdDistribution.ColWidth(2) = grdDistribution.Width * 0.15
    grdDistribution.ColWidth(3) = 0
    grdDistribution.ColWidth(4) = 0

    FormatGridHeader grdDistribution
    lngLBound = LBound(arrMidas, 2)
    lngUbound = UBound(arrMidas, 2)

    For lngCounter = lngLBound To lngUbound
        lngProductID = arrMidas(0, lngCounter)
        txtQuestion = arrMidas(1, lngCounter)
        If arrMidas(2, lngCounter) = True Then
            'driveline question.
            txtQuestion = txtQuestion & " *"
        End If
        blnEntryExit = arrMidas(3, lngCounter)

        grdDistribution.AddItem txtQuestion & vbTab & vbNullString & vbTab &
vbNullString & vbTab & blnEntryExit & vbTab & lngProductID

        grdDistribution.RowData(lngCounter + 1) = arrMidas(4, lngCounter)

        CheckGridCellHeight grdDistribution, lngCounter + 1

        'get answer
        fillMidasRowAnswer (lngCounter + 1)

        grdDistribution.Col = 1
        grdDistribution.Row = lngCounter + 1
        If blnEntryExit Then
            grdDistribution.CellForeColor = 0 '0 = standard background and
foreground colors
        Else
            grdDistribution.CellForeColor = RGB(192, 192, 192)
        End If

    Next

    grdDistribution.Row = 0
    grdDistribution.Col = 0



Sat, 17 Apr 2004 19:24:37 GMT  
 Grid Control Intermittently does not Show
David,
I have found a bug in the Grid control.
When the scrollbar displayed, that means the grid has a lot of item (rows) ,
and
you try to reset the grid by setting rows = 0 . The scrollbar internal value
is not
reset. A work around for that is set the Toprow = 0 before reset the grid.
Ex:

On Error Resume Next
grdDistribution.TopRow  = 0

Err.Clear
grdDistribution.Rows = 0

...................

Hope this help


Quote:
> Hello

> In our eVB App we are using the Grid control extensively with great
results.
> In one section of our App occaisionally it does not show up even though
it's
> exactly the same code that works okay normally.  Could there be a glitch
or
> bug?  If you restart the App and repeat the operation it works fine.

> Thanks

> David M

>   On Error GoTo 0

>     grdDistribution.Clear
>     grdDistribution.Rows = 0
>     txtDistributionHistory.Text = ""

>     ' Add grid header.
>     grdDistribution.AddItem vbNullString & vbTab & "Entry" & vbTab &
"Exit"
> & vbTab & vbNullString
>     grdDistribution.ColWidth(0) = grdDistribution.Width * 0.6
>     grdDistribution.ColWidth(1) = grdDistribution.Width * 0.15
>     grdDistribution.ColWidth(2) = grdDistribution.Width * 0.15
>     grdDistribution.ColWidth(3) = 0
>     grdDistribution.ColWidth(4) = 0

>     FormatGridHeader grdDistribution
>     lngLBound = LBound(arrMidas, 2)
>     lngUbound = UBound(arrMidas, 2)

>     For lngCounter = lngLBound To lngUbound
>         lngProductID = arrMidas(0, lngCounter)
>         txtQuestion = arrMidas(1, lngCounter)
>         If arrMidas(2, lngCounter) = True Then
>             'driveline question.
>             txtQuestion = txtQuestion & " *"
>         End If
>         blnEntryExit = arrMidas(3, lngCounter)

>         grdDistribution.AddItem txtQuestion & vbTab & vbNullString & vbTab
&
> vbNullString & vbTab & blnEntryExit & vbTab & lngProductID

>         grdDistribution.RowData(lngCounter + 1) = arrMidas(4, lngCounter)

>         CheckGridCellHeight grdDistribution, lngCounter + 1

>         'get answer
>         fillMidasRowAnswer (lngCounter + 1)

>         grdDistribution.Col = 1
>         grdDistribution.Row = lngCounter + 1
>         If blnEntryExit Then
>             grdDistribution.CellForeColor = 0 '0 = standard background and
> foreground colors
>         Else
>             grdDistribution.CellForeColor = RGB(192, 192, 192)
>         End If

>     Next

>     grdDistribution.Row = 0
>     grdDistribution.Col = 0



Fri, 23 Apr 2004 23:33:55 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. HFlex Grid not showing AddNew Bug

2. VB6 Databound Grid not showing data when DataSource is ODBC

3. control to show colored fields in a list/grid needed

4. How to Show a ComboBox in the Grid Control

5. MCI Control Gets Into a Tizzy - Done Events Not Being Generated

6. ADO Updates to SQL Server not Showing, though records affected shows true

7. Control will not show results of filter

8. VB component dialog box does not show MS Masked Edit Control 6.0

9. Controls do not show up

10. How to make Browser control NOT show pictures?

11. MS Calendar ActiveX Control not shown up

12. PARAM TAG: Control does not Show after reading PARAM values

 

 
Powered by phpBB® Forum Software