Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Preserving grid properties
Message
 
To
20/03/2004 18:57:34
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00888244
Message ID:
00888378
Views:
14
>Having done some research on that, I tried the approach suggested on FAQ #8019. I used the approach of adding a property ThisForm.lGridRefreshing. So, I set that to .T. before assigning my grid RecordSource property. I also added the proper code in the grid BeforeRowColChange() event. I put a messagebox in there just to be sure the code goes in there once I assign the property. The code never goes in there.
>
>This is what I have in my form Init():
>
>
>* Refresh the grid
>ThisForm.lGridRefreshing=.T.
>ThisForm.ControlFile.RecordSource='Control'
>ThisForm.ControlFile.Refresh()

Thisform.ControlFile.Setfocus

>DOEVENTS
>ThisForm.lGridRefreshing=.F.
>
>
>This is what I have in my form grid BeforeRowColChange():
>
>
>LPARAMETERS nColIndex
>
>MESSAGEBOX('in')
>* Used when we want to change the RecordSource of the grid and wish to preserve
>* the grid properties
>IF PEMStatus(ThisForm,'lGridRefreshing',5) AND ThisForm.lGridRefreshing
* Does this ever happen?
IF ThisForm.lGridRefreshing

>MESSAGEBOX('in2')
>
>   NODEFAULT
>   RETURN
>ENDIF
>
>
>This never go in. Any idea?
I am trying to understand how a rowchange event would be concurrent with a controlsource swap.

You may already have a marker implemeneted to assure a row change rather than a column change is fired. IOW : When you say row change you mean the highlight has changed records. A unique field in the cursor or the recno() can be stored in the grid's tag. When the 'rowchange' is fired should the field value or recno() prove different to the contents of grid's tag, the action was, at the least, not a column change.:)
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform