On 3/18/2013 5:44 PM, Rafael Copquin wrote:
Before you change anything that would affect the underlying cursor, just
issue this command:
thisform.grid1.recordsource = ''
do your changes
thisform.grid1.recordsource = 'theunderlying cursor'
Rafael Copquin
Years ago, I got this code from Paul Mrozowski:
This is my grid base class method called SaveSource:
LOCAL loColumn as Column
This.oColumnInfo = CREATEOBJECT("Collection")
FOR EACH loColumn IN This.Columns
This.oColumnInfo.Add(loColumn.ControlSource)
loColumn.ControlSource = .NULL.
ENDFOR
This.cOrigRecordSource = This.RecordSource
This.RecordSource = .NULL.
...and this is my grid base class method called RestoreSource:
LOCAL liIndex as Integer, loColumn as Column
IF VARTYPE(This.oColumnInfo) <> "O"
RETURN
ENDIF
liIndex = 1
This.RecordSource = This.cOrigRecordSource
FOR EACH loColumn IN This.Columns
loColumn.ControlSource = This.oColumnInfo.Item[liIndex]
liIndex = liIndex + 1
ENDFOR
...so in other areas (like Form.LoadMyData), it's a call like this:
this.Grid.SaveSource()
this.odata.RequeryMyDataSource('curData')
this.Grid.RestoreSource()
...where curData was the data source used in my grid.
Thanks, Paul! Got this from my 2006 short-time at Park West Gallery
with Paul and Andy Maki (amongst others).
--
Mike Babcock, MCP
MB Software Solutions, LLC
President, Chief Software Architect
http://mbsoftwaresolutions.com
http://fabmate.com
http://twitter.com/mbabcock16
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message:
http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the
author, and do not constitute legal or medical advice. This statement is added
to the messages for those lawyers who are too stupid to see the obvious.