Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dynamic checkbox caption in grid?
Message
From
01/06/2002 07:24:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00655970
Message ID:
00663780
Views:
25
>Is it possible to dynamically change the caption of a checkbox in a grid column to display "Yes" or "No" according to the datasource for the checkbox? When first asked by the client I gave the standard "Sure" but now I'm *not* so sure.
>
>Several times I've had it working except for an occasional "echo" into the adjacent row as long as focus remains in that column. Nothing I've tried displays the correct values after focus shifts to another column.

Lynda,
Wouldn't that be easy with a view ? With view instead of struggling with a checkbox or ligical value for that matter you'd be doing plain text control. ie:
create sql view v_products as select *, ;
 iif(Products.discontinu,"Yes","No ") AS disctext ;
 FROM products
* Updatable props etc - written by designer

In your grid then you'd use 'disctext' instead of logical discontinu. It could have these then :
*columnX properties
Format = 'M'
InputMask = 'Yes,No'
*columnX.Text1.Interactive and Programmatic change
replace discontinu with (this.Value = 'Yes') in ("v_products")
*columnX.Text1.Click
this.Value = iif(this.Value = 'Yes','No','Yes')
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform