Telerik blogs

RadGridView provides numerous handful approaches to customize its appearance, even at runtime. For example, you could use formatting events or the Style property. However, sometimes it is handy to specify complex conditions in a script form. In our previous release we introduced an expression editor which allows for using formulas and expressions both at design time and runtime. In our next release we will introduce the same powerful feature for conditional formatting. You and your end-users will be able to target and style RadGridView cells and rows using powerful expressions.

Conditional Formatting Expressions Overview

With the help of our existing rule-based conditional formatting you can easily highlight all cells of a column which have a value less than 01/01/1994. The formatting is created by a simple conditional formatting object with a rule and a style:

Conditional Formatting Expressions HireDate

On top of the existing functionality, the new expression formatting mechanism will allow for creating formatting expressions with high complexity and flexibility, for example:

IIF(TitleOfCourtesy ="Ms." OR TitleOfCourtesy = "Mrs.", true, false)

This expression selects all cells from the ‘TitleOfCourtesy’ column which have “Ms.” or “Mrs.” value.

To apply an expression, one should click with the right mouse button on a column header and select the Conditional Formatting option.  Then he\she should add a new rule and click the Expression option:

Conditional Formatting Manager

Clicking the Apply button will finish the process and will produce the following result:  

Conditionally Formatted Rad GridView for Windows Forms by Telerik

We hope you like our new functionality. As always, your feedback is highly appreciated.


About the Author

Nikolay Diyanov

Diyanov is the Product Manager of the Native Mobile UI division at Progress. Delivering outstanding solutions that make developers' lives easier is his passion and the biggest reward in his work. In his spare time, Nikolay enjoys travelling around the world, hiking, sun-bathing and kite-surfing.

Find him on Twitter @n_diyanov or on LinkedIn.

Related Posts

Comments

Comments are disabled in preview mode.