Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Controlling grid display
Message
From
22/06/2009 17:50:59
 
General information
Forum:
Visual FoxPro
Category:
Other
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01407400
Message ID:
01407703
Views:
28
>>Hi,
>>
>>>>Hi,
>>>>
>>>>I have a grid column (let's call it C1) whose controlsource is a character type field (from a local view).
>>>>The grid is desgined for display only (not to take input)
>>>>
>>>>Is it possible to conditionally display some of the values of C1 as indented (say prefix them with 3 space chars) without actually changing the value of the underlying field?
>>>>The condition is derived from another field in the same view as mentioned.
>>>
>>>Sure, you can put an expression in ControlSource ("myPrefix" + Table.Field). This makes the column readonly, but would work for you, as I understand.
>>
>>Just curious, what if the view needs to take user input...
>>Say the C1 contains a textbox, what can I do to achive the samething?
>
>Do you mean the predefined part to be user's input.
>
>In this case I think we need to set ControlSource in code
>
>thisform.cPrefix = 'our user input'

>
>thisform.grd1.Column1.ControlSource = "([" + thisform.cPrefix + "Table.Field" + "])"
>
>From the top of my head - not tested.

No... I mean the user will input whatever after the prefix (in C1 on the grid), i.e. user won't input the prefix, just the text after the prefix, and after the input is accepted, the grid will display it with a dummy prefix (thus won't change the actual value inputed by user). The underlying field value will remain whatever inputed by user... and whether or not the prefix will be added is depending on the value of another field in the same record.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform