WinForms Data Grid: Excel Inspired Conditional Formatting (Coming soon in v14.2)

Don Wibier's Blog
12 November 2014

One of the many features we’ve added to our Data Grid and Tree List controls is Excel inspired conditional formatting of individual data cells. This feature allows your end-user not only to sort or group the data inside the grid, but also to visualize selected cells, rows with data bars, icons and predefined or custom appearance schemes. 

WinForms-Grid-ExcelFormatting

We have built-in support for the following common comparison rules:

  • Top / Bottom
  • Above / Below Average
  • Greater / Less Than
  • Value List
  • Unique / Duplicate

You can obviously define even more (complex) conditions, in code yourself. By using the design-time facilities, you can define style conditions without writing a single line of code!

Conditional formatting rules allow you to modify cell backgrounds, text-colors and font-settings and can be applied to either a single cell or an entire row. In case of multiple formatting conditions apply on the same cell, we’ll just combine these conditions for you (unless specified otherwise).

We have added an extra menu item to the grid's column context menu to allow the end-user to apply the conditional formatting.

WinForms-Grid-ExcelFormatting-GridMenu

Stay tuned for more exiting new features in our v14.2 release!

Free DevExpress Products – Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We’ll be happy to follow-up.
Christopher Todd
Christopher Todd

Very interesting! Can't wait!!

12 November 2014
Alexander Krakhotko (Xafari team)
Alexander Krakhotko (Xafari team)

Beautiful

Does this new feature is available in XAF?

12 November 2014
Rolf Heinen
Rolf Heinen

Looks great !

13 November 2014
Rolf Heinen
Rolf Heinen

It looks great !

13 November 2014
Rolf Heinen
Rolf Heinen

it looks great !

13 November 2014
Chris Carter - EMI
Chris Carter - EMI

Does this include faster processing when applying conditional formatting?  In the current version applying conditional formatting across many cells takes so long that the CLR times out during debug.  Hopefully this addresses that issue because this looks fantastic, very excited for this change!

13 November 2014
Mark Bissett 2
Mark Bissett 2

Looks fantastic! Are these conditional formats stored when saving the grid layout? Would be incredibly useful if they are...

14 November 2014
Benjamin Hofmann
Benjamin Hofmann

Awesome!

14 November 2014
Christopher Hamel
Christopher Hamel

This is a great addition.  Will the format conditions be saved with the SaveLayoutToXml method?

14 November 2014
Heiko Mueller
Heiko Mueller

Absolutly phantastic - I'm sure my users will love this feature. This addition combined with the new export features really rocks...

15 November 2014
Raja Lakshman
Raja Lakshman

Awesome! Can't wait to give it a try and use in our production system. Thanks

16 November 2014
Marcel Boom
Marcel Boom

Nice!

16 November 2014
John Lancaster
John Lancaster

This is exactly what we were looking for. I cannot wait to show this feature to our user base!

17 November 2014
Steve Sharkey
Steve Sharkey

Any chance of some answers? I have been waiting on some of the answers to help decide on renewing my subscription!

18 November 2014
Dennis (DevExpress)
Dennis Garavsky (DevExpress)

@Alexander: XAF uses DevExpress controls for the UI generation and thus their new features are automatically available in an XAF app. Thanks.

21 November 2014
Olga (DevExpress Support)
Olga (DevExpress Support)

@Chris: Generally, style format conditions do not cause performance problems in regular scenarios. It is possible that you have a lot of records and columns in a grid and create many complex style format conditions. It is necessary to investigate performance degradation in detail for each particular case to understand its cause. That is why, you are welcome to post a ticket to our Support Center with a description of a problem and a test sample.

For new Excel-like conditional formatting, the same is true. Generally, everything should work smoothly. If you face any problem using this feature, it is necessary to investigate this case.

@Mark and Christopher: Yes, format rules are saved with the grid layout if the OptionsLayout.StoreFormatRules option is enabled.

Thanks for your interest.

21 November 2014
Gustavo Marzioni
Gustavo Marzioni

@Dennis, I could not do it  it in XAF out of the box (in 14.2 beta)

24 November 2014
Gustavo Marzioni
Gustavo Marzioni

@Dennis, sorry, a simple controler do the trick

Public Class gridController

   Inherits ViewController(Of ListView)

   Protected Overrides Sub OnViewControlsCreated()

       MyBase.OnViewControlsCreated()

       Dim listEditor As GridListEditor = TryCast((CType(View, ListView)).Editor, GridListEditor)

       If listEditor IsNot Nothing Then

           Dim gridView As XafGridView = listEditor.GridView

              gridView.OptionsMenu.ShowConditionalFormattingItem = True

       End If

   End Sub

End Class

24 November 2014
Christopher Hamel
Christopher Hamel

I just downloaded and installed 14.2...  I right-clicked on the column, but the conditional formatting does not appear.  Is there a property in the grid view I need to change?

4 December 2014
Antonio Moya
Antonio Moya

I have the same problem that Christopher Hamel... any help? 14.2.3 Winforms datagrid with linq instant feedback source...

9 December 2014
Antonio Moya
Antonio Moya

I found the solution: documentation.devexpress.com

9 December 2014
Antonio Moya
Antonio Moya

Now users can see the menu but it doesn't work... I'm using Linq Instant Feedback Source

9 December 2014
Dennis (DevExpress)
Dennis Garavsky (DevExpress)

@Gustavo: See also the www.devexpress.com/.../T291012 ticket for a complete XAF example. Thanks.

17 September 2015

Please login or register to post comments.