Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Column DataBinding feature I added to my grids...
Message
From
13/12/2009 10:53:52
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
12/12/2009 21:21:21
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP2
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01438702
Message ID:
01438826
Views:
49
>>>I just wanted to share some code from an idea I implemented to create and easy way to programmatically bind columns in my grids to a cursor, with a few other cool tricks too, like calculated fields and Casting to control decimal formats.
>>>
>>>See what you think... http://therealmattslay.blogspot.com/2009/12/grid-column-databinding-feature-for-vfp.html
>>>
>>>.
>>
>>Matt,
>>Isn't it easier just to simply assign the recordsource. Columns would be automatically bound in the order they are in cursor.
>>Cetin
>
>Well, sometimes my cursor has columns that I do not want to display in the grid (primary keys and foreign keys and other data that I just don't want to show).
>
>Plus, I may also want calculated columns, like (total = qty * price) (rate = laborcost / labor hrs). The columns required to do the calculations are in the cursor, but not the total or rate columns. I could add them to the sql , but who knows if this is good or not, if you do not have access to change SQL query.

Hmm, still what I said applies:) Create your SQL placing those columns you don't want to show being at the end. You can use less columns than the fields and simply set only calculated columns' controlsources.

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
Reply
Map
View

Click here to load this message in the networking platform