Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

How to highlight the cells of GridControl in WPF interface development

Shulou Source: shulou.com Published: 2022-06-01 10:19:01 11月21日 Update

This article introduces how to highlight the cells of GridControl in WPF interface development, the content is very detailed, interested friends can refer to, hope to be helpful to you.

With DevExpress WPF Controls, you can create powerful interactive XAML foundation applications that focus on the needs of contemporary customers and build a new generation of touch-enabled solutions in the future.

System background

Platform: WPF

Product: DXGrid for WPF

Framework: .NET Framework Build 18.2.10

Operating system: Windows 10 x64

IDE:Microsoft Visual Studio 2019

Problems encountered

When using a solution for CellTemplate columns in a grid, you need to change the background of the cell when the value changes. There is no CellTemplate method created. Is there a solution? Use only GridColumn?

Solution:

Because data items have separate Boolean properties that indicate that the Name or Change properties have been modified, you can use conditional formatting to change the appearance of cells based on these Boolean properties. More precisely, if you want the Name cell to be red when IsNameChanged is True, you can define the FormatCondition object, set its FieldName to Name, and create an Expression based on the IsNameChanged property:

Note that formatting conditions do not affect lines of current interest. However, you can use the method described here to support this feature: Formatting Focused Cells and Rows

On the WPF interface development is how to highlight the GridControl cells to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Tags: Unit property solution Boolean interface development content function application method more condition format program system background help application support Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Docker Huawei Shulou Technology macOS