Quantcast
Channel: West Wind Message Board Messages
Viewing all articles
Browse latest Browse all 10393

Re: Cell based formatting in Grids

$
0
0
Re: Cell based formatting in Grids
Web Connection 5.0
Re: Cell based formatting in Grids
11/05/2012
02:51:24 AM
3MY064HPWShow this entire thread in new window
Gratar Image based on email address
From:
Rick Strahl
To:
Attachments:
None

use "class='mycssclass'" instead of CssClass.

Actually in code it might better to use:

loGrid.ActiveColumn.CssClass = "mycssclass"

+++ Rick ---



Dear friends,
I would like to reproduce grid dynamic cell formatting like in the Class wwWebDataGrid Help example: some cells has red background and white forecolor.
I have a grid column with expression pointing to a function:

<ww:wwWebDataGridColumn ID="Column3" runat="server" Expression="this.page.GridColors(Field1)" HeaderText="IP"></ww:wwWebDataGridColumn>

then I have the function setting ActiveColumnAttributeString (Field1 is character, Field1 is logical:):

************************FUNCTION GridColors(m.Field1)************************WITHthisIFQuery.Field2=.T. .Grid1.ActiveColumnAttributeString="style='background:red;'"ENDIFRETURN m.Field1ENDWITHENDFUNC

This runs right, but I have ever text forecolor black, so I made a CssClass in my stylesheet to have forecolor white on background red:

.TextWhiteBackRed {color: #FFFFFF; background-color: #FF0000; }

and modified the function as follow:

************************FUNCTION GridColors(m.Field1)************************WITHthisIFQuery.Field2=.T. .Grid1.ActiveColumnAttributeString="CssClass=TextWhiteBackRed'"ENDIFRETURN m.Field1ENDWITHENDFUNC

but unfortunately it does not work.
Please some suggestion?
Thank you very much



Rick Strahl
West Wind Technologies


from Maui, Hawaii

Making waves on the Web


Viewing all articles
Browse latest Browse all 10393

Trending Articles