Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid problem

Status
Not open for further replies.

chinkoh

Programmer
Mar 15, 2002
8
MY
My Table have two type record
a)user key in ( editable )
b)computer gen ( non editable)

in grid how to control the computer gen. record cannot be edit..

thank you

eg table field

Code Amount Gen
A001 99.99 Y ( non editable)
A001 12.12 N (editable)
A001 123.12 N (editable)



 
HI
YOu can use
set filter to Gen = "N"
if you dont want to see the record.
Otherwise, in the grids when event of each column object, add the code..
IF GEN = "N"
RETURN .t.
ELSE
RETURN .f.
ENDIF
Hope this helps you :) ramani :-9
(Subramanian.G),FoxAcc, ramani_g@yahoo.com
 
or you can do: (Just like Ramani said)
Return (!Gen)
Assuming Gen is logical Ali Koumaiha -:)
 
Here's another method for you. Assuming that the editing is actually done directly in the grid, place this code into the grid's AfterRowColChange event:
[tt]
this.ReadOnly=(myTable.Gen='N')
[/tt]
Obviously, substitute "myTable" with the actual table alias you're using. This will make it so you can edit the data only when the record pointer is on a non-Gen record.

Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top