PRB: Form.SaveAs Appears to Change Order of Added Grid ColumnID: Q132533 The information in this article applies to:
SYMPTOMSThe Form.Grid.AddColumn() method allows you to add a column at run time to the grid, and have that column visually inserted between two existing columns. If the Form.SaveAs method is then used to save the form, and the form is modified by using the Form Designer, the newly inserted column appears at the end of the list of columns.
CAUSEThis is by design. The ColumnOrder property of the new column is set to one more than the current number of grid columns. When the form is saved and reopened, the ColumnOrder property affects the display order of the columns in the grid.
RESOLUTIONAfter adding a column through the AddColumn() method, set the ColumnOrder property of the new column prior to saving the form. The preexisting columns will have their ColumnOrder property incremented by one so that they are properly displayed when the form is reopened.
STATUSThis behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior1. Create a new form in the Form Designer. Add the Customer and Orders 2. Drag the Cust_id field from the Customer table to the form. Drag the
3. Set the following grid properties:
4. Save the form as frmGrid, and run the form.
5. Issue the following commands in the Command window:
6. Note the position of the column with the header of New." Close the
7. Notice that the column with the New header, which appeared as the second
Example ResolutionTo resolve the problem, insert the following line of code prior to the frmGrid.SaveAs() line in step 5:
Additional reference words: 3.00 VFoxWin
KBCategory: kbtool kbprb
KBSubcategory: FxtoolFormdes
|
Last Reviewed: July 31, 1995 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |