YUIAspNet controls for ASP.NET Ajax

Cell formatter

Using cell formatting, you have complete complete control over what gets rendered in the DataTable's cell.

You can specify a formatter for a column by setting a JavascriptFunctionFormat as the column's TemplateFormat property.

In this example, the "For" property uses a custom format which sets the color of the row with the value "car" to Red, the color of the row with value "bike" to green, and all other items' color to Blue.