JavaScript Editor js editor     Web development 

Main Page

File: ...\Samples\Solution\Controls\Grid\Dyngrid.scx

This sample illustrates setting the DynamicForeColor and DynamicBackColor properties of grid columns.

The code of interest in this sample is associated with the InteractiveChange event of the drop-down list cboFormat.

First, the code clears the dynamic fore and backcolor settings:

В Copy Code
oGrd.SetAll("dynamicbackcolor", "", "Column")
oGrd.SetAll("dynamicforecolor", "", "Column")

Then, code in a CASE statement sets the new DynamicForeColor or DynamicBackColor properties. For example, the following line of code displays discontinued items with a gray ForeColor.

В Copy Code
oGrd.SetAll("dynamicforecolor", ;
   "IIF(discontinu, RGB(192,192,192), RGB(0,0,0))", "Column")

Discontinu is a logical field in the Products table.

See Also

JavaScript Editor js editor     Web development