Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Disable grids rows dynamically
Message
From
29/08/2008 06:56:56
 
 
To
29/08/2008 03:13:45
Albert Beermann
Piepenbrock Service Gmbh & Cokg
Osnabrück, Germany
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
MySQL
Miscellaneous
Thread ID:
01342969
Message ID:
01342995
Views:
49
This message has been marked as the solution to the initial question of the thread.
Disable (or set to read only) some rows under spezial circumstances.

Add a custom method to you form called DisableGridRows() and put this code in it:
IF INLIST(Thisform.MyGrid.RowColChange,0,2) ;
     AND NOT ".INIT" $ PROGRAM(PROGRAM(-1)-1) ;
     AND NOT ".MOUSEDOWN" $ PROGRAM(PROGRAM(-1)-1)

   ***  row hasn't changed and this method hasn't been called from THIS.Init()
   *** and this method hasn't been called from THIS.MouseDown()
  RETURN
ENDIF

Thisform.MyGrid.AllowCellSelection = SomeCondition
IF NOT SomeCondition
  Thisform.MyGrid.SetAll("ReadOnly",.f.)
ENDIF
Now, add this line of code to the grid's MouseDown(), Init() and AfterRowColChange():
Thisform.DisableGridRows()
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform