Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid-Problem
Message
From
19/04/2017 10:28:35
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
01650412
Message ID:
01650417
Views:
59
Make sure that the cursor is always present! If you recreate it from scratch, for instance by using a SQL Select statement, the cursor is gone for a little while, and the grid loses its recordsource. http://weblogs.foxite.com/andykramek/2005/03/19/using-a-safe-select-to-preserve-your-grid/

>Hi there,
>
>on a form I have placed a grid and set a few properties like columncount and header-captions.
>In the ini of the form I create a cursor and assign it to the grid.
>
>thisform.makecursor("kpos")
>thisform.gridpad.cashgrid.RecordSource = ''
>SELECT kpos
>GO top
>thisform.gridpad.cashgrid.recordsourcetype = 1
>thisform.gridpad.cashgrid.recordsource = 'kpos'
>thisform.gridpad.cashgrid.column1.ControlSource = 'menge'  
>thisform.gridpad.cashgrid.column2.ControlSource = 'nummer'  
>thisform.gridpad.cashgrid.column3.ControlSource = 'titel' 
>thisform.gridpad.cashgrid.column4.ControlSource = 'wg'   
>thisform.gridpad.cashgrid.column5.ControlSource = 'preis'
>thisform.gridpad.cashgrid.column6.ControlSource = 'nlbetrag'      
>thisform.gridpad.cashgrid.column7.ControlSource = 'mwst'      
>thisform.gridpad.cashgrid.column8.ControlSource = 'gesamt'      
>
>
>When I later add a record to the cursor, the record is not displayed but the grid looses its
>properties. When I check its properties in the debugger, I can see that columncount is set to 0
>and the columns-collection is empty.
>I also tried to reset the properties in a form method but when this method is finished and another
>control gets the focus, the grid has again lost its properties.
>
>What might be wrong there?
>
>Thanks in advance
>
>Thomas
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform