This message serves for Google indexing. It only includes the first message of each thread from technical forums. To see the entire thread, the solutions and the technical content related to each message, you need to log in by going to the main page. This can be done at http://www.universalthread.com. If you do not have an account, we encourage you to create one now and start participating in Microsoft .NET and SQL Server related technology forums, just to name a few. Our database contains nearly two millions valuable high end technical messages. Thanks for the generous contribution to everyone who participated on the site so far, including MVP, Microsoft employees and many other well known contributors. The valuable content of the Universal Thread has created a history of 16 years of high end technical content which has helped many consultants, developers and many others in the industry on a daily basis. The site also offers a subscription option that greatly enhances your site experience.


View message
From01/07/1997 09:27:43
Bill Caton #005735
2020 Company
Lawrenceville, Georgia, United States
To  
All


I have a grid on a form with a column based on a logical field in a table. The column has the standard textbox plus a check box in it. The CurrentControl for the column is set to the check box. The ControlSource for the column is set to a UDF which will return "X" if the field is .T. and " " if .F. for the text box to display when the cell is not the active grid cell. The ControlSource for the check box is set to the logical field in the table. Sparse is set to .T., Bound for the column is set to .F..

In the init of the grid the DynamicCurrentControl of the column is set as follows:

THIS.COLUMN2.DYNAMICCURRENTCONTROL = "IIF( ( THIS.ACTIVECOLUMN = 2 AND RECNO() = THISFORM.LastRow ), 'Check1', 'TEXT1' )"

THISFORM.LastRow is updated in the AfterRowColChange event of the grid.

The effect I'm trying to get, of course, is when the cell is the active cell, the user sees the check box, otherwise the user sees the text box with an "X" or " " reflecting the logical contents of the field.

This works well except for one problem, if the user tabs into the cell while on the same record, the check box displays correcly. But if the user moves into the cell from another record, the check box does not display and the field is always blank even if the field is .T.. If the user then tabs out of the field and back in while remaining on the same record, the check box correctly displays.

What am I missing? This is in VFP5.0a.

Thanks,
Bill
William A. Caton III
Software Engineer
2020 Company
Atlanta, Ga.