Gridtest.exe Sample Grid Does Not Refresh Properly
ID: Q176093
|
The information in this article applies to:
-
Microsoft Visual FoxPro for Windows, versions 5.0, 5.0a, 6.0
SUMMARY
Gridtest.exe contains an example that demonstrates using a grid based on
two data sources. The sample shows that the grid may not display properly
when you navigate the master table with a custom toolbar while the focus on
the main form is in the grid.
MORE INFORMATIONThe following files are available for download from the Microsoft
Download Center. Click the file names below to download the files:
Gridtest.exe For more information about how to download files from the Microsoft
Download Center, please visit the Download Center at the following Web
address
http://www.microsoft.com/downloads/search.asp
and then click How to use the Microsoft Download Center.Symptoms
Under the following conditions, a grid based on two tables will not
display the correct data:
- Focus is on the grid making one of the grid cells active.
- A toolbar button that skips to the next or previous record is clicked.
- The number of records in the grid exceeds the number of records that may
be displayed.
- The grid is scrolled.
Whether or not the scroll thumb or the scroll arrows are used to scroll the
grid determines how the data is misrepresented. In either case, the records
from the second table are misrepresented.
Resolution
Here are two possible workarounds:
NOTE: If the navigation buttons are objects on the form, this problem does
not occur.
Status
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. We are researching this bug and will post
new information here in the Microsoft Knowledge Base as it becomes
available.
Steps to Reproduce Behavior
- Using the sample file run the form named Broken.
- Click the Next button located on the form. All the visible cells in the
first column of the grid should contain the number 2. Note that if
the grid is scrolled with either the scroll thumb or scroll arrows, all
the grid columns display correctly. The example below demonstrates
how the data should be displayed in the grid. The last row will not be
visible.
TBL2.F1 TBL2.F2 TBL3.F2 TBL3.F3
-----------------------------------------
2 a a Red
2 b b Blue
2 c c Green
2 d d Yellow
2 e e Brown
- Click in any cell of the grid. The grid now has focus on the form.
- Click the Previous button on the Toolbar, not the form.
- Scroll down the grid with the scroll thumb or slider. All the records in
the third column (TBL3.F2) will contain the letter "a." "Red" appears in
all the records of the fourth column (TLB3.F3).
Scroll down the grid with the scroll arrow. All the records in the third
column (TBL3.F2) will contain the letter "d." "Yellow" appears in all
the records of the fourth column (TLB3.F3).
Using the scroll thumb, scroll arrows, or clicking in one of the grid
cells does not cause that cell to refresh properly.
NOTE: The results of this step may be inconsistent and differ from what
is described here. What should be displayed is the example shown in step
2 above with the number 1 in the first grid column for all rows.
- Make sure that the focus is not in either the third or fourth grid
column, and then click the Grid Refresh button on the form. The grid
should now be back to normal. If one of the cells in the third or fourth
column had focus, it will not refresh, but all the others will. This
step implements the second workaround described in the Resolution
section above.
- Click in one of the grid cells, and then click the Next button on the
toolbar. The grid should move so that the number 2 is in the first
column (TBL2.F1). The data in the third and fourth columns should be
correct. Refer to the grid in step 2 above. Note that the last row
is not visible.
- Scroll the grid using the down scroll arrow. Note the values in the
third and fourth columns for the first visible record when you finish
scrolling.
If the scroll down was stopped, with only the last two records
displayed, and then the up scroll arrow is clicked, all the records
displayed from TBL3 will have the correct information. The example below
demonstrates how the data should be displayed in the grid.
TBL2.F1 TBL2.F2 TBL3.F2 TBL3.F3
--------------------------------------
2 a d Yellow
2 b d Yellow
2 c d Yellow
2 d d Yellow
2 e e Brown
If only the last record was visible when scrolling down stopped, then
all the records will contain an "e" in the third column (TBL3.F2)
and "Brown" in the fourth column (TBL3.F3) of the grid when
scrolling up.
- Modify the GridTtest.pjx sample project and examine the code in the
forms and visual classes.
Additional query words:
Grid Display
Keywords : kbfile kbsample kbDesigner kbVFp500 kbVFp600 kbDSupport
Version : WINDOWS:5.0,5.0a,6.0
Platform : WINDOWS
Issue type : kbinfo
|