Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid in VFP 6.0
Message
From
31/07/2001 04:43:47
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
31/07/2001 03:25:33
Ashish Patel
Hindustan Petroleum
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00537628
Message ID:
00537640
Views:
14
>I am using a grid in one of the form which takes up data from recordset.
>I have used Wizard to build the grid.
>
>I have used "Ledger" style which shows a beautiful grid showing light green colour heading and alternate rows as green. How can I change the color of this ?
>
>One of the field in the table is having width as character(1) and siaplay wither character "F" or "D" or "S". The field name is cash_type.
>
>I want to display "Normal" if cash_type is "F", "Shop Delivery" if Cash_type is "D" and
>"Pending Cashmemo" if cash_type is "S". Can I do that if my table field is having width of character (1). Is there ant other way ?
>
>
>Pl. Help. thanx in advance.
>
>
>Regards
>
>Ashish

Ashish,
If you edit grid and check column DynamicBackColor you'll see an expression like :
iif(recno()%2=0,...
It's that setting colors.

First you should decide how you would change it. Change just the colors or expression or both :) Then instead of doing that one-by-one for columns you just write code to grid.init :
*Color based on recno()
this.SetAll('DynamicBackColor',;
 'iif(recno()%2=0,rgb(255,255,0),rgb(0,255,255))','Column')
If your grid is readonly you can set any column as a calculated value (calculated fields are always readonly) :
*Assuming target column is 3
this.Columns(3).ControlSource = ;
  '( iif(cash_type="F","Normal", '+;
  '  iif(cash_type="D","Shop Delivery", ';
  '  iif(cash_type="S","Pending Cashmemo",""))) )'
Or you could write this expression directly to column's controlsource property removing single quotes and continuation.
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