Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

How to make multicolor in a single cell of DataGrid based on condition

$
0
0
Hello,
 
I need to make a multicolor in a single cell based on cell value in WPF datagrid.
 
For example:
I have a column which header is "InitialNames" and another column with a header "Available"
 
Let's say that it contains for example the following:
InitialNames
ABC/BD
BVF/GFD/YA
BD
 
Avaiable
0/1
0/0/0
1
 
It is all the time the substring.count for both columns in one row are the same.
 
What I need is that to substring the cell "available" based on "/" and if the value is 1 then the color of the same index in InitialNames column will be red.
 
I know how to do it in code using TextBlock.Inlines but I don't know how to replace the result in the datagrid cell "InitialNames" with the new inlines colored string.

Viewing all articles
Browse latest Browse all 18858

Trending Articles