>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 :
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) :
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