Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Conceptual - Grid with row switching btwn data and pictu
Message
From
15/10/2014 17:32:41
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
15/10/2014 16:44:36
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2008
Network:
Windows 2008 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01609489
Message ID:
01609490
Views:
85
>Hi,
>
>Have a grid where I would like the row content for one field to switch between displaying a file name or displaying an image of a file folder. Basically I am trying to get a simple grid to look a bit more like an explorer view.
>
>It does not have to be fancy as this app calls a document system's api and all they return is either all the document names in a folder or a folder name. I would just like to be able to allow users to see all the documents and then a slightly different image for a folder (folder name but with an image of a folder beside it, most likely in a separate column).
>
>Conceptually, is this going to work? I can set a flag in the table to indicate that the row is an entry for a folder but how do I have it switch between the two? Do I do some sort of IIF() to set .DynamicCurrentControl? and if so, anyone ever do this and it looks good or am I just trying to do something too funky?
>
>Just wanted to ask before I put a lot of time into making it work.

Actually, that's the only way to make this work. Now if there's some way to make the names of current controls stored in a field, that would make it rather fast; if not, icase() is your friend. If you want different pictures for different kinds of records, you need one image object per image - no way to change an image during a refresh without it affecting the image of the same object in other rows.

This was done before, so just go ahead and play with .dynamiccurrentcontrol - the only speed issue you may have is if the evaluation of the expression in that property may be too long. In that case, go back to my first proposal and store the actual names of controls to use for display in a field in your cursor (varchar preferrably, so you don't waste time trimming it) and store the name of the control once per created record. That would be much faster than having an expression evaluated once per record per refresh. Probably irrelevant with today's machines, but if you forget to close the debugger, you may notice some speed issues.

back to same old

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

Click here to load this message in the networking platform