Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Keep into variable a Grid cell value
Message
From
17/01/2012 06:35:27
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
 
To
17/01/2012 06:00:44
Luis Santos
Biglevel-Soluções Informáticas, Lda
Portugal
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
OS:
Windows 7
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Desktop
Miscellaneous
Thread ID:
01533070
Message ID:
01533074
Views:
47
>I read this example wher i can get the controlsource name of my column:
>
>with sbo.pageframe1.page1.cont1.grid1
> local nColumnIndex
> for m.nColumnIndex = 1 to .ColumnCount
> .Columns(m.nColumnIndex).Comment = .Columns(m.nColumnIndex).ControlSource
> msg(.Columns(m.nColumnIndex).ControlSource) && display BI.Article
> endfor
>endwith
>
>Is it possible to dysplay also the value for my textbox grid where the controlsource is " Bi.ARTICLE" , because i know the controlsource.
>
>for example my form have a grid with 2 columns
>
>article and description
>
>Article controlsource is BI.ARTICLE
>description controlsource is BI.DESCRIPTION

You can add a property to each column, something like this:
for i=1 to .columncount
   loCol=.columns[i]
   loCol.addProperty("oldValue", eval(loCol.controlsource))
endfor
Do this at the end of grid.init(). Then, in ARCC(), in your loop, you simply compare current value, i.e. eval(.Columns(m.nColumnIndex).ControlSource) with .Columns(m.nColumnIndex).oldValue and do whatever you want with them.

Note that you must do eval() to get the actual value. The .controlSource is the qualified name of the field, i.e. "Bi.Article", not the actual text inside the field.

Also, that loop which fills the .oldValue property for each column, should be run when you want the old value saved into a property. Now, this being a grid, it may be the best to call this code from .BRCC(), because grid has only one row (the other rows are only displays, the current row is the only one which has controls).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform